Round out the test suite
[skeinsum.git] / testing / Run_tests
1 #!/bin/sh
2 #
3 # Copyright (C) 2015 2019 Jason Self <j@jxself.org>
4 #
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved.  This file is offered as-is,
8 # without any warranty.
9
10 cd "$(dirname "$0")"
11
12 for f in *.command; do
13     n="$(basename "$f" .command)"
14     r="$n.result"
15     t="$n.$(date +%Y-%m-%d-%H%M%S)"
16     test -s "$r" || { echo "WARNING: missing $r"; continue; }
17     sh "$f" > $t 2>&1
18     diff -U0 "$r" "$t" && { rm "$t"; echo "$n completed successfully." ; continue; }
19     echo "ERROR: $n failed"
20     exit 1
21 done
22
23 ## END ##