X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=8de5e32fd920e83ed1015d2337a19387ddb16ca2;hb=b52ee879d869304c981be713566b40aa3f7a44db;hp=f34b1fb86af15eb89b91c328e2558d0f0eb8207b;hpb=d29ff5699de10394d7fdab41ce1c39e18c736332;p=obsolete%2Fnotmuch-old diff --git a/test/test-lib.sh b/test/test-lib.sh index f34b1fb8..8de5e32f 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -498,16 +498,18 @@ test_expect_equal_file () error "bug in the test script: not 2 or 3 parameters to test_expect_equal" file1="$1" + basename1=`basename "$file1"` file2="$2" + basename2=`basename "$file2"` if ! test_skip "$test_subtest_name" then if diff -q "$file1" "$file2" >/dev/null ; then test_ok_ "$test_subtest_name" else testname=$this_test.$test_count - cp "$file1" "$testname.$file1" - cp "$file2" "$testname.$file2" - test_failure_ "$test_subtest_name" "$(diff -u "$testname.$file1" "$testname.$file2")" + cp "$file1" "$testname.$basename1" + cp "$file2" "$testname.$basename2" + test_failure_ "$test_subtest_name" "$(diff -u "$testname.$basename1" "$testname.$basename2")" fi fi } @@ -985,6 +987,14 @@ test_emacs () { done fi + # Clear test-output output file. Most Emacs tests end with a + # call to (test-output). If the test code fails with an + # exception before this call, the output file won't get + # updated. Since we don't want to compare against an output + # file from another test, so start out with an empty file. + rm -f OUTPUT + touch OUTPUT + emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)" }