Skip to content

Commit

Permalink
style: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 18, 2024
1 parent 1da0201 commit 317bbcb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lisp/test/buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
(let* ((load-path (cons "." load-path))
;; this does not include options
(args (eask-args)))
;; buttercup-run-discover uses command-line-args-left not command-line-args
;; `buttercup-run-discover' uses `command-line-args-left' not `command-line-args'
(setq command-line-args-left args)
;; Seems like buttercup-run-discover only works on directories that are children of
;; the current directory.
;; When given a parent directory it always fails with "No suites found", even if there are tests.
;; Since this is a bit confusing, we warn the user specifically.
;; See discussion https://github.com/emacs-eask/cli/pull/281
(when-let ((bad-arg (seq-find (lambda (x) (not (file-in-directory-p x default-directory))) args)))
;; Seems like `buttercup-run-discover' only works on directories that are
;; children of the current directory. When given a parent directory it
;; always fails with "No suites found", even if there are tests.
;; Since this is a bit confusing, we warn the user specifically;
;; see discussion https://github.com/emacs-eask/cli/pull/281.
(when-let* ((bad-arg (seq-find (lambda (x)
(not (file-in-directory-p x default-directory)))
args)))
(error "Buttercup cannot run in parent directory: %s" bad-arg))
(buttercup-run-discover)))

Expand Down

0 comments on commit 317bbcb

Please sign in to comment.