From c76489d611ad7340a2e57f3312820494d5c7ddbb Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 5 Nov 2013 23:50:18 -0800 Subject: [PATCH] Skip some tests rather than expect failure when prereqs not met * automated/flymake-tests.el (warning-predicate-rx-gcc) (warning-predicate-function-gcc, warning-predicate-rx-perl) (warning-predicate-function-perl): * automated/info-xref.el (info-xref-test-makeinfo): * automated/vc-bzr.el (vc-bzr-test-bug9726, vc-bzr-test-bug9781) (vc-bzr-test-faulty-bzr-autoloads): Skip rather than expect failure. --- test/ChangeLog | 9 +++++++++ test/automated/flymake-tests.el | 10 ++++------ test/automated/info-xref.el | 3 +-- test/automated/vc-bzr.el | 13 +++---------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index 26111ce5030..aac3f6836ae 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,12 @@ +2013-11-06 Glenn Morris + + * automated/flymake-tests.el (warning-predicate-rx-gcc) + (warning-predicate-function-gcc, warning-predicate-rx-perl) + (warning-predicate-function-perl): + * automated/info-xref.el (info-xref-test-makeinfo): + * automated/vc-bzr.el (vc-bzr-test-bug9726, vc-bzr-test-bug9781) + (vc-bzr-test-faulty-bzr-autoloads): Skip rather than expect failure. + 2013-11-05 Michael Albinus * automated/tramp-tests.el: New file. diff --git a/test/automated/flymake-tests.el b/test/automated/flymake-tests.el index 2b2f3ee1528..34a7b4f3696 100644 --- a/test/automated/flymake-tests.el +++ b/test/automated/flymake-tests.el @@ -47,28 +47,26 @@ (ert-deftest warning-predicate-rx-gcc () "Test GCC warning via regexp predicate." - :expected-result (if (executable-find "gcc") :passed :failed) + (skip-unless (executable-find "gcc")) (should (eq 'flymake-warnline (flymake-tests--current-face "test.c" "^[Ww]arning")))) (ert-deftest warning-predicate-function-gcc () "Test GCC warning via function predicate." - :expected-result (if (and (executable-find "gcc") (executable-find "make")) - :passed - :failed) + (skip-unless (and (executable-find "gcc") (executable-find "make"))) (should (eq 'flymake-warnline (flymake-tests--current-face "test.c" (lambda (msg) (string-match "^[Ww]arning" msg)))))) (ert-deftest warning-predicate-rx-perl () "Test perl warning via regular expression predicate." - :expected-result (if (executable-find "perl") :passed :failed) + (skip-unless (executable-find "perl")) (should (eq 'flymake-warnline (flymake-tests--current-face "test.pl" "^Scalar value")))) (ert-deftest warning-predicate-function-perl () "Test perl warning via function predicate." - :expected-result (if (executable-find "perl") :passed :failed) + (skip-unless (executable-find "perl")) (should (eq 'flymake-warnline (flymake-tests--current-face "test.pl" diff --git a/test/automated/info-xref.el b/test/automated/info-xref.el index 973af0d46c7..54cd534e8ce 100644 --- a/test/automated/info-xref.el +++ b/test/automated/info-xref.el @@ -95,8 +95,7 @@ text. (ert-deftest info-xref-test-makeinfo () "Test that info-xref can parse basic makeinfo output." - :expected-result (if (executable-find "makeinfo") :passed :failed) - (should (executable-find "makeinfo")) + (skip-unless (executable-find "makeinfo")) (let ((tempfile (make-temp-file "info-xref-test" nil ".texi")) (tempfile2 (make-temp-file "info-xref-test2" nil ".texi")) (errflag t)) diff --git a/test/automated/vc-bzr.el b/test/automated/vc-bzr.el index 2776435be82..18918607c27 100644 --- a/test/automated/vc-bzr.el +++ b/test/automated/vc-bzr.el @@ -27,14 +27,9 @@ (require 'vc-bzr) (require 'vc-dir) -;; FIXME it would be better to skip all these tests if there is no -;; bzr installed. We could just put everything inside an IF -;; statement, but it would be nice if ERT had a "skipped" facility (?). - (ert-deftest vc-bzr-test-bug9726 () "Test for http://debbugs.gnu.org/9726 ." - :expected-result (if (executable-find vc-bzr-program) :passed :failed) - (should (executable-find vc-bzr-program)) + (skip-unless (executable-find vc-bzr-program)) (let* ((tempdir (make-temp-file "vc-bzr-test" t)) (ignored-dir (expand-file-name "ignored-dir" tempdir)) (default-directory (file-name-as-directory tempdir))) @@ -64,8 +59,7 @@ ;; Not specific to bzr. (ert-deftest vc-bzr-test-bug9781 () "Test for http://debbugs.gnu.org/9781 ." - :expected-result (if (executable-find vc-bzr-program) :passed :failed) - (should (executable-find vc-bzr-program)) + (skip-unless (executable-find vc-bzr-program)) (let* ((tempdir (make-temp-file "vc-bzr-test" t)) (subdir (expand-file-name "subdir" tempdir)) (file (expand-file-name "file" tempdir)) @@ -101,8 +95,7 @@ ;; http://lists.gnu.org/archive/html/help-gnu-emacs/2012-04/msg00145.html (ert-deftest vc-bzr-test-faulty-bzr-autoloads () "Test we can generate autoloads in a bzr directory when bzr is faulty." - :expected-result (if (executable-find vc-bzr-program) :passed :failed) - (should (executable-find vc-bzr-program)) + (skip-unless (executable-find vc-bzr-program)) (let* ((tempdir (make-temp-file "vc-bzr-test" t)) (file (expand-file-name "foo.el" tempdir)) (default-directory (file-name-as-directory tempdir)) -- 2.39.2