Changeset 209dfe2


Ignore:
Timestamp:
Jul 21, 2021, 3:36:56 PM (6 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
jacob/cs343-translation, master, new-ast-unique-expr
Children:
080471a, aa882e7e
Parents:
9698690
Message:

The exception benchmark can now also extract results from files.

File:
1 edited

Legend:

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

    r9698690 r209dfe2  
    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.