forked from glen/fostr
chore: Switch to this repository from predecessor
This commit is contained in:
parent
9ecfa63f58
commit
7b00b01856
23 changed files with 733 additions and 32 deletions
33
bin/run_tests
Executable file
33
bin/run_tests
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
command=$1
|
||||
ext=$2
|
||||
total=0
|
||||
failed=0
|
||||
diffed=0
|
||||
|
||||
for dir in tests/extracted/*; do
|
||||
for file in $dir/*.$ext; do
|
||||
((total++))
|
||||
$command $file > $file.out
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo ERROR: $command $file failed.
|
||||
((failed++))
|
||||
else
|
||||
if [[ -f ${file%.*}.expect ]]; then
|
||||
echo ---- diff ${file%.*}.expect $file.out ----
|
||||
diff ${file%.*}.expect $file.out
|
||||
if [[ $? -ne 0 ]]; then
|
||||
((diffed++))
|
||||
fi
|
||||
echo -------------------------------
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
echo "Ran $total tests: $failed failures, $diffed runs differed."
|
||||
if [[ $failed -gt 0 ]] || [[ $diffed -gt 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue