Subject: Re: bug#9803: Add ERT option to skip test

From: Michael Albinus <[email-masked]>
Date: Thu, 04 Jul 2013 20:40:10 +0200

Glenn Morris <[email-masked]> writes:

> I think it would be nice if ert had the ability to skip tests.
> Eg, a :skip argument that works the same way as :expected-result.
> This would be useful eg when a test relies on external executable that
> might not be installed on the system running the tests. You can get the
> same result by using :expected-result, but :skip might be nicer in such
> cases.

Skipping tests is already possible. Instead of writing

(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))
  ...

you could do

(when (executable-find vc-bzr-program)
  (ert-deftest vc-bzr-test-bug9726 ()
    "Test for http://debbugs.gnu.org/9726 ."
    ...

The only drawback I see is that such skipped tests are not listed in the
output of an ert run.

Best regards, Michael.