diff options
Diffstat (limited to 'test/ccured_olden/power/testit')
-rwxr-xr-x | test/ccured_olden/power/testit | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/ccured_olden/power/testit b/test/ccured_olden/power/testit new file mode 100755 index 00000000..b5132dd7 --- /dev/null +++ b/test/ccured_olden/power/testit @@ -0,0 +1,26 @@ +#!/bin/sh +# test a power binary + +if [ "$1" = "" ]; then + echo "usage: $0 ./power.exe" + exit +fi + +# all of power's output is to stdout +echo "running: $1 >output" +if ! $1 >output; then + echo "$1 failed directly" + exit 2 +fi + +# must strip elapsed time +# must truncate precision to only 5 decimal places, because gcc's optimizer +# (even with -ffloat-store) seems to change the answer under boxing +if ! grep -v "Elapsed time" <output | \ + sed 's/\(\.[0-9]\{5\}\)[0-9]*/\1/g' | diff out.orig - >/dev/null; then + echo "$1 got the wrong answer" + exit 4 +else + echo "$1 seems to work" +fi +
\ No newline at end of file |