[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup b97714d 144/340: Declare all variables before fi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup b97714d 144/340: Declare all variables before first use |
Date: |
Thu, 16 Dec 2021 14:59:21 -0500 (EST) |
branch: elpa/buttercup
commit b97714dfee1a00f6ef4da20e39b40b40fd6d57af
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Jorgen Schäfer <Jorgen.Schaefer@gmail.com>
Declare all variables before first use
This eliminates all compiler warnings about free variables.
---
buttercup.el | 92 +++++++++++++++++++++++++++++++-----------------------------
1 file changed, 47 insertions(+), 45 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 64048f8..c80b471 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1096,6 +1096,53 @@ responsibility to ensure ARG is a command."
;;;;;;;;;;;;;;;;
;;; Test Runners
+;; These variables are generally used in the test runners, but set
+;; elsewhere. They must be defined here before their first use.
+(defvar buttercup-reporter #'buttercup-reporter-adaptive
+ "The reporter function for buttercup test runs.
+
+During a run of buttercup, the value of this variable is called
+as a function with two arguments. The first argument is a symbol
+describing the event, the second depends on the event.
+
+The following events are known:
+
+buttercup-started -- The test run is starting. The argument is a
+ list of suites this run will execute.
+
+suite-started -- A suite is starting. The argument is the suite.
+ See `make-buttercup-suite' for details on this structure.
+
+spec-started -- A spec in is starting. The argument is the spec.
+ See `make-buttercup-spec' for details on this structure.
+
+spec-done -- A spec has finished executing. The argument is the
+ spec.
+
+suite-done -- A suite has finished. The argument is the spec.
+
+buttercup-done -- All suites have run, the test run is over.")
+
+(defvar buttercup-stack-frame-style (car '(crop full pretty))
+ "Style to use when printing stack traces of tests.
+
+`full' is roughly the same style as normal Emacs stack traces:
+print each stack frame in full with no line breaks. `crop' is
+like full, but truncates each line to 80 characters. `pretty'
+uses `pp' to generate a multi-line indented representation of
+each frame, and prefixes each stack frame with lambda or M to
+indicate whether it represents a normal evaluated function call
+or a macro/special form.")
+
+(defvar buttercup-color t
+ "Whether to use colors in output.")
+
+(defconst buttercup-warning-buffer-name " *Buttercup-Warnings*"
+ "Buffer name used to collect warnings issued while running a spec.
+
+A buffer with this name should only exist while running a test
+spec, and should be killed after running the spec.")
+
;;;###autoload
(defun buttercup-run-at-point ()
"Run the buttercup suite at point."
@@ -1272,34 +1319,6 @@ Do not change the global value.")
;;;;;;;;;;;;;
;;; Reporters
-(defvar buttercup-reporter #'buttercup-reporter-adaptive
- "The reporter function for buttercup test runs.
-
-During a run of buttercup, the value of this variable is called
-as a function with two arguments. The first argument is a symbol
-describing the event, the second depends on the event.
-
-The following events are known:
-
-buttercup-started -- The test run is starting. The argument is a
- list of suites this run will execute.
-
-suite-started -- A suite is starting. The argument is the suite.
- See `make-buttercup-suite' for details on this structure.
-
-spec-started -- A spec in is starting. The argument is the spec.
- See `make-buttercup-spec' for details on this structure.
-
-spec-done -- A spec has finished executing. The argument is the
- spec.
-
-suite-done -- A suite has finished. The argument is the spec.
-
-buttercup-done -- All suites have run, the test run is over.")
-
-(defvar buttercup-color t
- "Whether to use colors in output.")
-
(defun buttercup-reporter-adaptive (event arg)
"A reporter that handles both interactive and noninteractive sessions.
@@ -1488,12 +1507,6 @@ Calls either `buttercup-reporter-batch' or
(send-string-to-terminal (apply #'format fmt args)))
-(defconst buttercup-warning-buffer-name " *Buttercup-Warnings*"
- "Buffer name used to collect warnings issued while running a spec.
-
-A buffer with this name should only exist while running a test
-spec, and should be killed after running the spec.")
-
(defadvice display-warning (around buttercup-defer-warnings activate)
"Log all warnings to a special buffer while running buttercup tests.
@@ -1603,17 +1616,6 @@ failed -- The second value is the description of the
expectation
frame (backtrace-frame n)))
frame-list))
-(defvar buttercup-stack-frame-style (car '(crop full pretty))
- "Style to use when printing stack traces of tests.
-
-`full' is roughly the same style as normal Emacs stack traces:
-print each stack frame in full with no line breaks. `crop' is
-like full, but truncates each line to 80 characters. `pretty'
-uses `pp' to generate a multi-line indented representation of
-each frame, and prefixes each stack frame with lambda or M to
-indicate whether it represents a normal evaluated function call
-or a macro/special form.")
-
(defun buttercup--format-stack-frame (frame &optional style)
(pcase (or style buttercup-stack-frame-style 'crop)
(`full (format " %S" (cdr frame)))
- [nongnu] elpa/buttercup f60ed2a 119/340: Bump version: 1.5 → 1.6, (continued)
- [nongnu] elpa/buttercup f60ed2a 119/340: Bump version: 1.5 → 1.6, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 677d6d3 118/340: Merge pull request #70 from xendk/color-output, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d8dc80d 126/340: Bump version: 1.6 → 1.7, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b6deeff 128/340: Set Emacs 24.3 as minimum and clean outdated code (close #89), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 39c7d8c 132/340: Allow ERT "should" and similar to work with buttercup, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e8140aa 133/340: Implement configurable stack traces, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e6f97d0 136/340: Release 1.8, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e26ea54 137/340: Let spy-on :and-return-value work with lists and symbols (close #104), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e55e3d8 138/340: travis: Test on 25.1 and 25.2, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c032c8f 141/340: Exec code blocks in markdown labeled as "emacs-lisp" and "elisp", ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b97714d 144/340: Declare all variables before first use,
ELPA Syncer <=
- [nongnu] elpa/buttercup 4128f3e 147/340: Document ERT support in writing-tests.md, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 47dd72c 156/340: Set file local variables for consistent code style, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5458dcc 158/340: Replace buttercup-*-parents with buttercup-suite-or-spec-parents, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 77367d3 165/340: Change shebang to use /usr/bin/env, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bbbf692 166/340: Fix more compile warnings., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bcaa7f0 163/340: Use buttercup--specs where possible, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 61ebe91 171/340: Update README.md, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 39d625c 173/340: Bump version: 1.11 → 1.12, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6330610 176/340: Add more markdown running functions, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 3d3aff9 178/340: Set file local code-style variables in test-buttercup.el, ELPA Syncer, 2021/12/16