summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOla Nilsson <ola.nilsson@gmail.com>2017-10-13 20:58:19 +0200
committerJorgen Schäfer <Jorgen.Schaefer@gmail.com>2017-10-20 14:27:58 +0200
commit4063f5592728ce77a29c10ad730f2fd2833acaff (patch)
tree95f6b47d56865ffdbc1168d405cc32823449607c
parent0c1dcda1e87dbb794c1f39afd3c68ab1e6c68262 (diff)
Add function buttercup--specs
-rw-r--r--buttercup.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/buttercup.el b/buttercup.el
index 87b2e5f..54d54ba 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -727,6 +727,15 @@ See also `buttercup-define-matcher'."
"Return the number of failed specs in all suites in SUITE-LIST."
(buttercup-suites-total-specs-status suite-list 'failed))
+(defun buttercup--specs (spec-or-suite-list)
+ "Return a flat list of all specs in SPEC-OR-SUITE-LIST."
+ (let (specs)
+ (dolist (spec-or-suite spec-or-suite-list specs)
+ (if (buttercup-spec-p spec-or-suite)
+ (setq specs (append specs (list spec-or-suite)))
+ (setq specs (append specs (buttercup--specs
+ (buttercup-suite-children spec-or-suite))))))))
+
(defun buttercup--specs-and-suites (spec-or-suite-list)
"Return a flat list of all specs and suites in SPEC-OR-SUITE-LIST."
(let ((specs-and-suites nil))