Skip to content

Commit

Permalink
feat(test): Make ert-runner accepts files arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 13, 2024
1 parent 8d917bf commit d9041ea
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lisp/test/ert-runner.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
;;
;; Command to run ert tests using ert-runner,
;;
;; $ eask ert-runner
;; $ eask ert-runner [files..]
;;
;;
;; Positionals:
;;
;; [files..] specify files to run ert tests
;;

;;; Code:
Expand All @@ -20,9 +25,25 @@
(when (eask-reach-verbosity-p 'debug)
(setq ert-runner-verbose t))))

(defun eask-test-ert-runner--run (fnc &rest args)
"Run around function `ert-runner/run'.
Arguments FNC and ARGS are used for advice `:around'.
Handle the argument ARGS when command arguments are specified."
(let* ((patterns (eask-args))
(files (eask-expand-file-specs patterns)))
(setq args files))
(apply fnc args))

(advice-add 'ert-runner/run :around #'eask-test-ert-runner--run)

(eask-start
;; Preparation
(eask-archive-install-packages '("gnu" "melpa")
'ert-runner)

;; Start Testing
(require 'ert-runner))

;;; test/ert-runner.el ends here

0 comments on commit d9041ea

Please sign in to comment.