diff options
Diffstat (limited to 'test/llvm-ir-tests.sh')
-rwxr-xr-x | test/llvm-ir-tests.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/llvm-ir-tests.sh b/test/llvm-ir-tests.sh new file mode 100755 index 0000000..46ef922 --- /dev/null +++ b/test/llvm-ir-tests.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +readonly OUT=/tmp/llvm-ir-tests-out +trap "rm -f $OUT" EXIT + +for f in ./test/data/*.yx +do + if ! ./oryx -l "$f" \ + | sed '1,/^$/d' \ + | diff -u --color=always - "${f%%yx}ll" >$OUT + then + file="$(basename "$f" .yx)" + echo "llvm-ir-tests: Test ‘$file’ failed" >&2 + printf '\tFailing diff:\n' >&2 + cat $OUT + exit 1 + fi +done |