diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-02-02 23:33:34 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-02-03 11:58:31 +0100 |
commit | 3ada6e0606e12dbb5d79eacf8e0eb87997477b51 (patch) | |
tree | a1f97fe1f84657c836c06e2fb5cd1e49336ebf61 /tests | |
parent | 2cb627f3ba79bfce98e4cf6ab4b2e8029e8cb09e (diff) |
run_tests.sh: always treat outputs as text data
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/custom/run_tests.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/custom/run_tests.sh b/tests/custom/run_tests.sh index d09859c..a8c87bb 100755 --- a/tests/custom/run_tests.sh +++ b/tests/custom/run_tests.sh @@ -85,7 +85,10 @@ run_testcase() { IFS=$' \t\n' - $ucode_bin $args -e '{ "REQUIRE_SEARCH_PATH": [ "'"$ucode_lib"'/*.so" ] }' -i - <"$in" >"$dir/res.out" 2>"$dir/res.err" + $ucode_bin $args -e '{ + "REQUIRE_SEARCH_PATH": [ "'"$ucode_lib"'/*.so" ], + "TESTFILES_PATH": "'"$dir"'/files" + }' -i - <"$in" >"$dir/res.out" 2>"$dir/res.err" ) printf "%d\n" $? > "$dir/res.code" @@ -94,7 +97,7 @@ run_testcase() { if ! cmp -s "$dir/res.err" "${err:-$dir/empty}"; then [ $fail = 0 ] && printf "!\n" printf "Testcase #%d: Expected stderr did not match:\n" $num - diff -u --color=always --label="Expected stderr" --label="Resulting stderr" "${err:-$dir/empty}" "$dir/res.err" + diff -au --color=always --label="Expected stderr" --label="Resulting stderr" "${err:-$dir/empty}" "$dir/res.err" printf -- "---\n" fail=1 fi @@ -102,7 +105,7 @@ run_testcase() { if ! cmp -s "$dir/res.out" "${out:-$dir/empty}"; then [ $fail = 0 ] && printf "!\n" printf "Testcase #%d: Expected stdout did not match:\n" $num - diff -u --color=always --label="Expected stdout" --label="Resulting stdout" "${out:-$dir/empty}" "$dir/res.out" + diff -au --color=always --label="Expected stdout" --label="Resulting stdout" "${out:-$dir/empty}" "$dir/res.out" printf -- "---\n" fail=1 fi @@ -110,7 +113,7 @@ run_testcase() { if [ -n "$code" ] && ! cmp -s "$dir/res.code" "$code"; then [ $fail = 0 ] && printf "!\n" printf "Testcase #%d: Expected exit code did not match:\n" $num - diff -u --color=always --label="Expected code" --label="Resulting code" "$code" "$dir/res.code" + diff -au --color=always --label="Expected code" --label="Resulting code" "$code" "$dir/res.code" printf -- "---\n" fail=1 fi |