aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/test_all.sh
diff options
context:
space:
mode:
Diffstat (limited to 'samples/test_all.sh')
-rwxr-xr-xsamples/test_all.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/samples/test_all.sh b/samples/test_all.sh
index 45b85ae..e6086d5 100755
--- a/samples/test_all.sh
+++ b/samples/test_all.sh
@@ -5,6 +5,10 @@ if [ -z "$1" ]; then
exit 1
fi
+# =================
+# Euler/Fun/Rosetta
+# =================
+
echo "# useful for run the tests of all samples at once" >All.bruijn
echo >>All.bruijn
@@ -22,4 +26,19 @@ if cat /dev/null | bruijn -v All.bruijn -r "$1" | tee /dev/fd/2 | grep -q "ERROR
exit 1
fi
-# hyperfine --warmup 5 --runs 20 "cat /dev/null | bruijn -r $1 All.bruijn"
+# ===
+# AOC
+# ===
+
+FILES="$(find aoc -type f -name "*.bruijn")"
+
+for f in $FILES; do
+ dir="$(dirname "$f")"
+ cat "$dir/input" | bruijn -r "$1" "$f" | tail -n1 >temp.out
+ cmp temp.out "$dir/output.check" || (
+ echo "AOC check $f failed"
+ exit 1
+ )
+done
+
+rm -f temp.out