X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=test%2Fsuites%2Fvalid%2Frun;h=fa594e6b673b6608607a9cb8269f2e84afb2a82c;hb=5df7b7939794abc9e8a826919d84d27385a6679d;hp=cd88a0795bc09f1b6769f19d8626ea92eae98c73;hpb=fa7c2ea070672d05b34b6341142a193e9a7d0a8c;p=jansson.git diff --git a/test/suites/valid/run b/test/suites/valid/run index cd88a07..fa594e6 100755 --- a/test/suites/valid/run +++ b/test/suites/valid/run @@ -11,19 +11,45 @@ is_test() { test -d $test_path } +do_run() { + variant=$1 + s=".$1" + + strip=0 + [ "$variant" = "strip" ] && strip=1 + + STRIP=$strip $json_process \ + <$test_path/input >$test_log/stdout$s 2>$test_log/stderr$s + valgrind_check $test_log/stderr$s || return 1 + + ref=output + [ -f $test_path/output$s ] && ref=output$s + + if ! cmp -s $test_path/$ref $test_log/stdout$s; then + echo $variant > $test_log/variant + return 1 + fi +} + run_test() { - $json_process <$test_path/input >$test_log/stdout 2>$test_log/stderr - valgrind_check $test_log/stderr || return 1 - cmp -s $test_path/output $test_log/stdout + do_run normal && do_run strip } show_error() { valgrind_show_error && return + read variant < $test_log/variant + s=".$variant" + + echo "VARIANT: $variant" + echo "EXPECTED OUTPUT:" - nl -bn $test_path/output + ref=output + [ -f $test_path/output$s ] && ref=output$s + nl -bn $test_path/$ref + echo "ACTUAL OUTPUT:" - nl -bn $test_log/stdout + nl -bn $test_log/stdout$s } . $top_srcdir/test/scripts/run-tests.sh