emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4d866fc0f5: Interpret a "" value of EMACS_TEST_VERBOSE as "off"


From: Lars Ingebrigtsen
Subject: master 4d866fc0f5: Interpret a "" value of EMACS_TEST_VERBOSE as "off"
Date: Fri, 21 Jan 2022 06:32:43 -0500 (EST)

branch: master
commit 4d866fc0f561b023cbc15ee52891cddfa1a354ef
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 doc/misc/ert.texi      | 5 +++--
 lisp/emacs-lisp/ert.el | 6 ++++--
 test/README            | 4 ++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index 0d01efb035..91288db45a 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -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
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 9c6b0e15bb..b6c5b7d6b9 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -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" ""))
diff --git a/test/README b/test/README
index e44c4a43ee..2ab34ba20e 100644
--- a/test/README
+++ b/test/README
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]