emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/buttercup 86e8637e32 3/7: Extract buttercup--reporter-batc


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup 86e8637e32 3/7: Extract buttercup--reporter-batch-preprint-spec-p
Date: Thu, 28 Mar 2024 18:59:30 -0400 (EDT)

branch: elpa/buttercup
commit 86e8637e32c4f5e73e05b17db8fdc90f25158ee1
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>

    Extract buttercup--reporter-batch-preprint-spec-p
    
    ... from buttercup-reporter-batch.
---
 buttercup.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index a1b695cbb8..8925b4ac58 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1820,6 +1820,14 @@ Two special statuses can be listed in
            (string= (buttercup-spec-failure-description spec) "PENDING"))
       ))
 
+(defun buttercup--reporter-batch-preprint-spec-p (spec)
+  "Return non-nil if the SPEC description should be printed at `spec-started'."
+  (not (or buttercup-reporter-batch-quiet-statuses
+           ;; Do not 'pre-print' in github actions unless color is
+           ;; disabled. See #181.
+           (and buttercup-color
+                (string-match-p "[\n\v\f]" (buttercup-spec-description 
spec))))))
+
 (defun buttercup-reporter-batch (event arg)
   "A reporter that handles batch sessions.
 
@@ -1844,10 +1852,8 @@ EVENT and ARG are described in `buttercup-reporter'."
            (push arg buttercup-reporter-batch--suite-stack)
          (buttercup--print "%s\n" (buttercup--indented-description arg))))
       (`spec-started
-       (or buttercup-reporter-batch-quiet-statuses
-           (and buttercup-color
-                (string-match-p "[\n\v\f]" (buttercup-spec-description arg)))
-           (buttercup--print "%s" (buttercup--indented-description arg))))
+       (when (buttercup--reporter-batch-preprint-spec-p arg)
+         (buttercup--print "%s" (buttercup--indented-description arg))))
       (`spec-done
        (when (and buttercup-reporter-batch-quiet-statuses
                   (not (buttercup-reporter-batch--quiet-spec-p arg)))



reply via email to

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