diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-05-15 23:19:42 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-05-15 23:19:42 +0200 |
commit | 2173d3fdeffc0da5dde2c063a2ed0a90f58dc4e1 (patch) | |
tree | 47fb6253f3007132bd402f01bcb40356cebc2653 /test.sh |
Initial
Diffstat (limited to 'test.sh')
-rwxr-xr-x | test.sh | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#!/usr/bin/env bash +total=0 +correct=0 +for inf in tests/*.in; do + base="${inf//.in}" + outf="$base.out" + tmpf="$base.tmp" + if ! ./solve <"$inf" >"$tmpf" 2>/dev/null; then + echo "\x1B[33mERROR\x1B[0m solve returned $?" + fi + total=$((total+1)) + if ! diff "$tmpf" "$outf" >/dev/null; then + echo "failure on $inf" + else + rm "$tmpf" + correct=$((correct+1)) + fi +done +if test $correct -eq $total; then printf "\x1B[33mOK"; else printf "\x1B[31mFAILURE"; fi +printf "\x1B[0m: %d/%d\n" "$correct" "$total" |