Interpret a "" value of EMACS_TEST_VERBOSE as "off"

* doc/misc/ert.texi (Running Tests in Batch Mode): Adjust doc.
* lisp/emacs-lisp/ert.el (ert-run-tests-batch): Allow overriding
the EMACS_TEST_VERBOSE variable by setting it to "" (bug#53313).
This commit is contained in:
Lars Ingebrigtsen 2022-01-21 12:32:10 +01:00
parent 5561d5de56
commit 4d866fc0f5
3 changed files with 9 additions and 6 deletions

View file

@ -444,8 +444,9 @@ emacs -batch -l ert -l my-tests.el \
@vindex EMACS_TEST_VERBOSE@r{, environment variable}
By default, ERT test failure summaries are quite brief in batch
mode---only the names of the failed tests are listed. If the
@env{EMACS_TEST_VERBOSE} environment variable is set, the failure
summaries will also include the data from the failing test.
@env{EMACS_TEST_VERBOSE} environment variable is set and is non-empty,
the failure summaries will also include the data from the failing
test.
@vindex EMACS_TEST_JUNIT_REPORT@r{, environment variable}
ERT can produce JUnit test reports in batch mode. If the environment

View file

@ -1423,7 +1423,8 @@ Returns the stats object."
(message "%9s %S%s"
(ert-string-for-test-result result nil)
(ert-test-name test)
(if (getenv "EMACS_TEST_VERBOSE")
(if (cl-plusp
(length (getenv "EMACS_TEST_VERBOSE")))
(ert-reason-for-test-result result)
""))))
(message "%s" ""))
@ -1435,7 +1436,8 @@ Returns the stats object."
(message "%9s %S%s"
(ert-string-for-test-result result nil)
(ert-test-name test)
(if (getenv "EMACS_TEST_VERBOSE")
(if (cl-plusp
(length (getenv "EMACS_TEST_VERBOSE")))
(ert-reason-for-test-result result)
""))))
(message "%s" ""))

View file

@ -111,8 +111,8 @@ debugging. To do that, use
By default, ERT test failure summaries are quite brief in batch
mode--only the names of the failed tests are listed. If the
$EMACS_TEST_VERBOSE environment variable is set, the failure summaries
will also include the data from the failing test.
$EMACS_TEST_VERBOSE environment variable is set and non-empty, the
failure summaries will also include the data from the failing test.
If the $EMACS_TEST_JUNIT_REPORT environment variable is set to a file
name, a JUnit test report is generated under this name.