diff options
author | Camil Staps | 2015-11-30 20:45:39 +0100 |
---|---|---|
committer | Camil Staps | 2015-11-30 20:48:24 +0100 |
commit | d7ded2f26819497366823edf0cdb586b5f4e8722 (patch) | |
tree | fd989bb381486e91a5d16f0a791a503d61fc069b /Practical2/tester | |
parent | Practical2 seems to work (diff) |
C version practical2
Diffstat (limited to 'Practical2/tester')
-rwxr-xr-x | Practical2/tester/test.sh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Practical2/tester/test.sh b/Practical2/tester/test.sh index f0f46e8..693ceda 100755 --- a/Practical2/tester/test.sh +++ b/Practical2/tester/test.sh @@ -1,15 +1,25 @@ #!/bin/bash java="/usr/lib/jvm/java-8-openjdk-amd64/bin/java" +# Java +#dir="$(dirname $0)/../out/production/Practical2" +#samples="../../../tester/samples" +#cmd="$java nl.camilstaps.cs.Main" + +# C +dir="$(dirname $0)/../c" +samples="../tester/samples" +cmd="./checkout" + failed=0 -cd "$(dirname $0)/../out/production/Practical2" -for tc in ../../../tester/samples/*.in; do +cd "$dir" +for tc in "$samples/"*.in; do answer=$(cat ${tc/in/out}) header=$(head -n1 "$tc" | tr -d '\n') echo -n "Running $(basename $tc) $(printf '%-12s' "($answer ")$(printf '%-12s' "/ $header)") ... " time_start=$(($(date +%s%N)/1000000)) - result=$(eval "cat '$tc' | /usr/lib/jvm/java-8-openjdk-amd64/bin/java nl.camilstaps.cs.Main") + result=$(eval "cat '$tc' | $cmd") time_end=$(($(date +%s%N)/1000000)) time=`expr $time_end - $time_start` if [ $result != $answer ]; then |