[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup bd55e2b 330/340: Add stacktrace style `omit`
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup bd55e2b 330/340: Add stacktrace style `omit` |
Date: |
Thu, 16 Dec 2021 15:00:01 -0500 (EST) |
branch: elpa/buttercup
commit bd55e2b9c6a6d557394d6a8e8daf33af541832d1
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>
Add stacktrace style `omit`
Setting the backtrace style to `omit` will disable the entire
post-report from the batch-reporter. This means that the names of
failing tests will not be repeated.
Fixes #190.
---
bin/buttercup | 21 +++++++++++----------
bin/buttercup.bat | 21 +++++++++++----------
buttercup.el | 7 +++++--
tests/test-buttercup.el | 8 +++++++-
4 files changed, 34 insertions(+), 23 deletions(-)
diff --git a/bin/buttercup b/bin/buttercup
index 601a8e0..2230e84 100755
--- a/bin/buttercup
+++ b/bin/buttercup
@@ -47,16 +47,17 @@ Buttercup options:
--traceback STYLE When printing backtraces for errors that occur
during tests, print them in the chosen
- STYLE. Available styles are "full", which
- shows the full function call for each stack
- frame on a single line, "crop", which
- truncates each stack frame to 80 characters
- (the default), and "pretty", which uses
- Emacs' pretty-printing facilities to print
- each stack frame, and also annotates each
- frame with a lambda or M to indicate whether
- it is a normal function call or a
- macro/special form.
+ STYLE. Available styles are
+ "full", which shows the full function call for
+ each stack frame on a single line,
+ "crop", which truncates each stack frame to 80
+ characters (the default),
+ "pretty", which uses Emacs' pretty-printing
+ facilities to print each stack frame, and also
+ annotates each frame with a lambda or M to
+ indicate whether it is a normal function call
+ or a macro/special form and
+ "omit", which omits the backtraces alltogether.
--stale-file-error Fail the test run if stale .elc files are loaded.
EOF
diff --git a/bin/buttercup.bat b/bin/buttercup.bat
index edff81d..108c910 100644
--- a/bin/buttercup.bat
+++ b/bin/buttercup.bat
@@ -51,16 +51,17 @@ echo --no-color, -c Do not colorize test output.
echo.
echo --traceback STYLE When printing backtraces for errors that occur
echo during tests, print them in the chosen
-echo STYLE. Available styles are "full", which
-echo shows the full function call for each stack
-echo frame on a single line, "crop", which
-echo truncates each stack frame to 80 characters
-echo ^(the default^), and "pretty", which uses
-echo Emacs' pretty-printing facilities to print
-echo each stack frame, and also annotates each
-echo frame with a lambda or M to indicate whether
-echo it is a normal function call or a
-echo macro/special form.
+echo STYLE. Available styles are
+echo "full", which shows the full function call for
+echo each stack frame on a single line,
+echo "crop", which truncates each stack frame to 80
+echo characters (the default),
+echo "pretty", which uses Emacs' pretty-printing
+echo facilities to print each stack frame, and also
+echo annotates each frame with a lambda or M to
+echo indicate whether it is a normal function call
+echo or a macro/special form and
+echo "omit", which omits the backtraces alltogether.
echo.
echo --stale-file-error Fail the test run if stale .elc files are loaded.
exit /b
diff --git a/buttercup.el b/buttercup.el
index e6e4cb7..17264b1 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1761,10 +1761,12 @@ Finally print the elapsed time for SPEC."
(buttercup-colorize (concat " " failure) color)))
(buttercup--print " (%s)\n" (buttercup-elapsed-time-string spec))))
-(defun buttercup-reporter-batch--print-failed-spec-report (failed-spec color)
+(cl-defun buttercup-reporter-batch--print-failed-spec-report (failed-spec
color)
"Print a failure report for FAILED-SPEC.
Colorize parts of the output if COLOR is non-nil."
+ (when (eq buttercup-stack-frame-style 'omit)
+ (cl-return-from buttercup-reporter-batch--print-failed-spec-report))
(let ((description (buttercup-spec-failure-description failed-spec))
(stack (buttercup-spec-failure-stack failed-spec))
(full-name (buttercup-spec-full-name failed-spec)))
@@ -1967,10 +1969,11 @@ ARGS according to `debugger'."
(defun buttercup--format-stack-frame (frame &optional style)
"Format stack FRAME according to STYLE.
-STYLE can be one of `full', `crop', or `pretty'.
+STYLE can be one of `full', `crop', `pretty', or `omit'.
If STYLE is nil, use `buttercup-stack-frame-style' or `crop'."
(setq style (or style buttercup-stack-frame-style 'crop))
(pcase style
+ (`omit) ; needed to verify valid styles
(`full (format " %S" (cdr frame)))
(`crop
(let ((line (buttercup--format-stack-frame frame 'full)))
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index bdca141..1ab60d1 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -1487,7 +1487,13 @@ text properties using `ansi-color-apply'."
(*? (seq "\n " (* not-newline))) ; any number of
pp lines
(* not-newline) ")\n")) ;; frame end
"error: (" (* anything) ")\n\n"
- string-end))))))
+ string-end)))))
+ (it "`omit' should print nothing"
+ (with-local-buttercup
+ :suites test-suites :reporter #'backtrace-reporter
+ :frame-style 'omit
+ (buttercup-run :noerror)
+ (expect (buttercup-output) :to-equal ""))))
(it "should signal an error for unknown styles"
(let ((buttercup-stack-frame-style 'not-a-valid-style))
(expect (buttercup--format-stack-frame '(t myfun 1 2))
- [nongnu] elpa/buttercup 24a7bb9 306/340: Extract buttercup-reporter-batch--print-spec-done-line, (continued)
- [nongnu] elpa/buttercup 24a7bb9 306/340: Extract buttercup-reporter-batch--print-spec-done-line, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c9addd5 307/340: Lift spec-done handling into buttercup-reporter-batch, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d6de872 309/340: Improve buttercup-reporter-batch--print-failed-spec-report, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 392b99c 310/340: Extend batch reporters to optionally print sparse reports, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup f6ab784 315/340: test: Test on GNU Emacs 27.1, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4d974d2 319/340: Use correct function for --stale-file-error, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a37d1a0 325/340: Fix compilation warning about undefined variable., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b4e0986 333/340: Merge pull request #194 from doublep/eldev-doc, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 108d229 340/340: Fix property comparisons in unit tests., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup dacfacc 332/340: Recognize buttercup--mark-stackframe in buttercup--enclosed-expr, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bd55e2b 330/340: Add stacktrace style `omit`,
ELPA Syncer <=
- [nongnu] elpa/buttercup b574cb2 331/340: test: Fix byte compiler errors and warnings, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9e1c5c9 329/340: test: Add tests for backtrace prints, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 1de6be4 339/340: Bump version: 1.23 → 1.24, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8b3f7a0 336/340: Merge pull request #199 from wasamasa/print-args-as-sexp, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 3a0a58f 065/340: Test buttercup--print., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e6fd5f5 096/340: Track pending specs separately, ELPA Syncer, 2021/12/16