X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=f218fa03202a886b6144f4f957c2fe3104dece6e;hb=f6fcdf12da455d82a9ed0a0a33eddac60253a6e8;hp=eec5c5b4508c1224d7b2510fe3822ce13e374bc0;hpb=bf8aa34324cc91a530b0b12f833f106c939f7d84;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index eec5c5b4..f218fa03 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -388,6 +388,14 @@ test_expect_equal_message_body () { test "$#" = 2 || error "bug in the test script: not 2 parameters to test_expect_equal_file" + for file in "$1" "$2"; do + if [ ! -s "$file" ]; then + test_failure_ "Missing or zero length file: $file" + inside_subtest= + return 1 + fi + done + expected=$(sed '1,/^$/d' "$1") output=$(sed '1,/^$/d' "$2") test_expect_equal "$expected" "$output" @@ -740,6 +748,12 @@ test_subtest_known_broken () { test_subtest_known_broken_=t } +test_subtest_broken_for_root () { + if [ "$EUID" = "0" ]; then + test_subtest_known_broken_=t + fi +} + test_expect_success () { exec 1>&6 2>&7 # Restore stdout and stderr if [ -z "$inside_subtest" ]; then