Skip to content

Commit

Permalink
Make ecukes accept files
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Mar 16, 2024
1 parent 5f47b73 commit dd531a9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ $ eask [GLOBAL-OPTIONS] test buttercup
Run [ecukes][] tests.

```sh
$ eask [GLOBAL-OPTIONS] test ecukes
$ eask [GLOBAL-OPTIONS] test ecukes [FILES..]
```

## 🔍 eask test melpazoid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ $ eask [GLOBAL-OPTIONS] test buttercup
運行 [ecukes][] 測試。

```sh
$ eask [GLOBAL-OPTIONS] test ecukes
$ eask [GLOBAL-OPTIONS] test ecukes [FILES..]
```

## 🔍 eask test melpazoid
Expand Down
28 changes: 27 additions & 1 deletion lisp/test/ecukes.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
;;
;; $ eask ecukes
;;
;;
;; Positionals:
;;
;; [files..] specify feature files to do ecukes tests
;;

;;; Code:

Expand All @@ -14,13 +19,34 @@
(locate-dominating-file dir "_prepare.el"))
nil t))

(defun eask-test-ecukes--run (files)
"Run ecukes on FILES.
Modified from function `ecukes-cli/run'."
(ecukes-load)
(ecukes-reporter-use ecukes-cli-reporter)
(ecukes-run files))

(eask-start
;; Preparation
(eask-with-archives '("gnu" "melpa")
(eask-package-install 'ecukes))

;; Start Testing
(require 'ecukes)
(ecukes))
(let* ((patterns (eask-args))
(files (eask-expand-file-specs patterns)))
(cond
;; Files found, do the action!
(files
(eask-test-ecukes--run files))
;; Pattern defined, but no file found!
(patterns
(eask-msg "")
(eask-info "(No files match wildcard: %s)"
(mapconcat #'identity patterns " ")))
;; Run default action.
(t
(ecukes)))))

;;; test/ecukes.el ends here

0 comments on commit dd531a9

Please sign in to comment.