Ignore:
Timestamp:
Aug 4, 2021, 2:40:11 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
199894e
Parents:
0640189e (diff), df5b2c8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/code/test.sh

    r0640189e r5541ea3d  
    11#!/usr/bin/env bash
    22
    3 # Usage: LANGUAGE TEST | -b SOURCE_FILE
     3# Usage:
     4# test.sh LANGUAGE TEST
     5#   Run the TEST in LANGUAGE.
     6# test.sh -b SOURCE_FILE...
     7#   Build a test from SOURCE_FILE(s).
     8# test.sh -v LANGUAGE TEST FILE
     9#   View the result from TEST in LANGUAGE stored in FILE.
    410
    511readonly ITERATIONS=1000000 # 1 000 000, one million
     
    3844        done
    3945        exit 0
     46elif [ "-v" = "$1" -a 4 = "$#" ]; then
     47    TEST_LANG="$2"
     48    TEST_CASE="$3"
     49    VIEW_FILE="$4"
    4050elif [ 2 -eq "$#" ]; then
    4151        TEST_LANG="$1"
     
    116126
    117127case "$TEST_LANG" in
    118 cfa-t) echo $CFAT; $CFAT;;
    119 cfa-r) echo $CFAR; $CFAR;;
    120 cpp) echo $CPP; $CPP;;
    121 java) echo $JAVA; $JAVA;;
    122 python) echo $PYTHON; $PYTHON;;
     128cfa-t) CALL="$CFAT";;
     129cfa-r) CALL="$CFAR";;
     130cpp) CALL="$CPP";;
     131java) CALL="$JAVA";;
     132python) CALL="$PYTHON";;
    123133*)
    124134        echo "No such language: $TEST_LANG" >&2
     
    126136        ;;
    127137esac
     138
     139echo $CALL
     140
     141if [ -n "$VIEW_FILE" ]; then
     142    grep -A 1 -B 0 "$CALL" "$VIEW_FILE" | sed -n -e 's!Run-Time (ns): !!;T;p'
     143    exit
     144fi
     145
     146$CALL
Note: See TracChangeset for help on using the changeset viewer.