(if (zerop skipped)
""
(format ", %s skipped" skipped))
- (ert--format-time-iso8601 (ert--stats-end-time stats))
+ (if ert-batch-print-duration
+ (format
+ "%s, %f sec"
+ (ert--format-time-iso8601 (ert--stats-end-time stats))
+ (float-time
+ (time-subtract
+ (ert--stats-end-time stats)
+ (ert--stats-start-time stats))))
+ (ert--format-time-iso8601 (ert--stats-end-time stats)))
(if (zerop expected-failures)
""
(format "\n%s expected failures" expected-failures)))
# Whether to run tests from .el files in preference to .elc, we do
# this by default since it gives nicer stacktraces.
# If you just want a pass/fail, setting this to no is much faster.
-TEST_LOAD_EL ?= yes
+export TEST_LOAD_EL ?= \
+ $(if $(findstring $(MAKECMDGOALS), all check check-maybe),no,yes)
# Additional settings for ert.
ert_opts =
"(ert)") or https://www.gnu.org/software/emacs/manual/html_node/ert/
for more information on writing and running tests.
+Tests could be tagged by the developer. In this test directory, the
+following tags are recognised:
+
+* :expensive-test
+ The test needs a serious amount of time to run. It is not intended
+ to run on a regular basis by users. Instead, it runs on demand
+ only, or during regression tests.
+
+* :unstable
+ The test is under development. It shall run on demand only.
+
The Makefile in this directory supports the following targets:
* make check
- Run all tests as defined in the directory. Expensive tests are
- suppressed. The result of the tests for <filename>.el is stored in
- <filename>.log.
+ Run all tests as defined in the directory. Expensive and unstable
+ tests are suppressed. The result of the tests for <filename>.el is
+ stored in <filename>.log.
* make check-maybe
Like "make check", but run only the tests for files which have
* make check-expensive
Like "make check", but run also the tests marked as expensive.
+* make check-all
+ Like "make check", but run all tests.
+
* make <filename> or make <filename>.log
Run all tests declared in <filename>.el. This includes expensive
tests. In the former case the output is shown on the terminal, in
You could use predefined selectors of the Makefile. "make <filename>
SELECTOR='$(SELECTOR_DEFAULT)'" runs all tests for <filename>.el
-except the tests tagged as expensive.
+except the tests tagged as expensive or unstable.
If your test file contains the tests "test-foo", "test2-foo" and
"test-foo-remote", and you want to run only the former two tests, you
could use a selector regexp: "make <filename> SELECTOR='\"foo$$\"'".
Note that although the test files are always compiled (unless they set
-no-byte-compile), the source files will be run by default, to give
-nicer backtraces. To run the compiled version of a test use
+no-byte-compile), the source files will be run when expensive or
+unstable tests are involved, to give nicer backtraces. To run the
+compiled version of a test use
make TEST_LOAD_EL=no ...