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

From: Michael Albinus <[email-masked]>
Date: Sat, 19 Oct 2013 08:44:14 +0200

Glenn Morris <[email-masked]> writes:

> Thank you, looks nice.
> Your method is not quite how I imagined it working, but maybe your way is
> better, I haven't thought about it much... With your approach, it seems
> like I have to specify the skip condition twice? Eg I have to write:
>
> (ert-deftest foo-test ()
>   "Test for foo."
>   :expected-result (if (executable-find "foo") :passed :skipped)
>   (skip-if (not (executable-find "foo")))
>   t ; in a real use case, some test using "foo" here
> )
>
> rather than:
>
> (ert-deftest foo-test ()
>   "Test for foo."
>   :skip (not (executable-find "foo"))
>   t)

No. The idea is that skip-if works whatever you have defined in
:expected-result. It simply ignores :expected-result, when it finds a
non-nil form.

> Also, ert-run-tests-batch-and-exit seems to need updating:
>
>   Running 1 tests (2013-10-18 17:49:11-0700)
>     skipped  1/1  foo-test
>
>   Ran 1 tests, 0 results as expected (2013-10-18 17:49:11-0700)
>
> I don't think "0 results as expected" is appropriate.

Will check. I've tested the interactive call so far.

Best regards, Michael.