summaryrefslogtreecommitdiff
path: root/test/automated/zlib-tests.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-11-04 21:54:38 -0500
committerGlenn Morris <rgm@gnu.org>2013-11-04 21:54:38 -0500
commitd511238048873be2947be33485072357ca3a7fe7 (patch)
treef5084d956e5804481d9d0b811c80a13aeb06a274 /test/automated/zlib-tests.el
parent194b4d9f7da7d539173b03d8a0ad434a86f6e124 (diff)
Make it possible to run tests with a different working directory
* test/automated/flymake-tests.el (flymake-tests-data-directory): New. (flymake-tests--current-face): Use flymake-tests-data-directory. (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): Adapt for above change. * test/automated/zlib-tests.el (zlib-tests-data-directory): New. (zlib--decompress): Use zlib-tests-data-directory.
Diffstat (limited to 'test/automated/zlib-tests.el')
-rw-r--r--test/automated/zlib-tests.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/automated/zlib-tests.el b/test/automated/zlib-tests.el
index d03d4c981b..57823a2e2d 100644
--- a/test/automated/zlib-tests.el
+++ b/test/automated/zlib-tests.el
@@ -23,6 +23,10 @@
(require 'ert)
+(defvar zlib-tests-data-directory
+ (expand-file-name "data/decompress" (getenv "EMACS_TEST_DIRECTORY"))
+ "Directory containing zlib test data.")
+
(ert-deftest zlib--decompress ()
"Test decompressing a gzipped file."
(when (and (fboundp 'zlib-available-p)
@@ -30,7 +34,8 @@
(should (string=
(with-temp-buffer
(set-buffer-multibyte nil)
- (insert-file-contents-literally "data/decompress/foo-gzipped")
+ (insert-file-contents-literally
+ (expand-file-name "foo-gzipped" zlib-tests-data-directory))
(zlib-decompress-region (point-min) (point-max))
(buffer-string))
"foo\n"))))