Skip to content

Commit

Permalink
Add a comment about buttercup warning and check full paths too
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbax189 committed Nov 17, 2024
1 parent 64c0bb5 commit fb4abda
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lisp/test/buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
(args (eask-args)))
;; buttercup-run-discover uses command-line-args-left not command-line-args
(setq command-line-args-left args)
(when (cl-some (apply-partially #'string-prefix-p "..") args)
(error "Buttercup cannot run in parent directories"))
;; 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)))

;;; test/buttercup.el ends here

0 comments on commit fb4abda

Please sign in to comment.