diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-12-09 18:42:45 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-12-09 18:42:45 +0100 |
commit | 6a0325b3ab8e4680de8b4786ada721a1e671157c (patch) | |
tree | eb0367379d1e9dc66913f79d646ed7c3c908f9a9 /test.sh |
Initial
Diffstat (limited to 'test.sh')
-rwxr-xr-x | test.sh | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -e +set -o pipefail + +function prepare() { + fname="$1" + ext="${fname##*.}" + base="${fname:0:${#fname}-${#ext}-1}" + case "$ext" in + py) + echo "./$fname" + ;; + c|cpp) + make "$base" 2>&1 | grep -v 'is up to date' >&2 + echo "./$base" + ;; + rip) + echo "rip $fname" + ;; + *) + echo >&2 "No handler for file '$fname'!" + exit 1 + esac +} + + +for i in $(seq 1 25); do + for a in a b; do + exe="" + for fname in $i$a.{py,c,cpp,rip}; do + test -f $fname || continue + cmd="$(prepare "$fname")" + echo -n "$i$a: \"$cmd\" " + diff <($cmd <$i.in 2>/dev/null) $i$a.out + echo ok + done + done +done |