aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test-lib.sh
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-09-29 13:55:12 -0400
committerGravatar David Bremner <bremner@debian.org>2012-09-30 11:40:22 -0300
commit61a9448b58ca1320d97cfe580155cf23b5b9ad62 (patch)
tree70dd9b4dd093c76a488cce2437d9a6f49997abe9 /test/test-lib.sh
parent1ecacab28fe10abf367ce4d6e4bac4a0642861e9 (diff)
test: Clear test-output output file before running Emacs tests
Most Emacs tests end with a call to (test-output), which saves the buffer to a filed called OUTPUT. Previously, if the test code failed with an exception before this call, the test framework would then compare against the OUTPUT file from the last Emacs test, resulting in confusing diffs. This requires one tweak to an emacs test that made two calls to test_emacs and expected an OUTPUT file from the first call. We simply reverse the order of the test_emacs calls.
Diffstat (limited to 'test/test-lib.sh')
-rw-r--r--test/test-lib.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test-lib.sh b/test/test-lib.sh
index f34b1fb8..7448b454 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -985,6 +985,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 $@)"
}