Skip to content

Commit

Permalink
feat(test): Add built-in ecukes test command
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Mar 16, 2024
1 parent 3e8d89f commit 5f47b73
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 2 deletions.
31 changes: 31 additions & 0 deletions cmds/test/ecukes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (C) 2024 the Eask authors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

"use strict";

exports.command = ['ecukes [files..]'];
exports.desc = 'Run ecukes tests';
exports.builder = yargs => yargs
.positional(
'[files..]', {
description: 'specify feature files to do ecukes tests',
type: 'array',
});

exports.handler = async (argv) => {
await UTIL.e_call(argv, 'test/ecukes', argv.files);
};
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,14 @@ Run [buttercup][] tests.
$ eask [GLOBAL-OPTIONS] test buttercup
```

## 🔍 eask test ecukes

Run [ecukes][] tests.

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

## 🔍 eask test melpazoid

Run [melpazoid][] tests.
Expand Down Expand Up @@ -1063,6 +1071,7 @@ Do not use a proxy for any URL matching pattern.
[ert]: https://www.gnu.org/software/emacs/manual/html_node/ert/
[ert-runner]: https://github.com/rejeep/ert-runner.el
[buttercup]: https://github.com/jorgenschaefer/emacs-buttercup
[ecukes]: https://github.com/ecukes/ecukes
[melpazoid]: https://github.com/riscy/melpazoid

[elisp-autofmt]: https://codeberg.org/ideasman42/emacs-elisp-autofmt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,14 @@ $ eask [GLOBAL-OPTIONS] test ert-runner
$ eask [GLOBAL-OPTIONS] test buttercup
```

## 🔍 eask test ecukes

運行 [ecukes][] 測試。

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

## 🔍 eask test melpazoid

運行 [melpazoid][] 測試。
Expand Down Expand Up @@ -1049,6 +1057,7 @@ $ eask --proxy "localhost:8888" [COMMAND]
[ert]: https://www.gnu.org/software/emacs/manual/html_node/ert/
[ert-runner]: https://github.com/rejeep/ert-runner.el
[buttercup]: https://github.com/jorgenschaefer/emacs-buttercup
[ecukes]: https://github.com/ecukes/ecukes
[melpazoid]: https://github.com/riscy/melpazoid

[elisp-autofmt]: https://codeberg.org/ideasman42/emacs-elisp-autofmt
Expand Down
5 changes: 4 additions & 1 deletion lisp/test/buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
nil t))

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

;; Start Testing
(require 'buttercup)
;; Propose fix from https://github.com/jorgenschaefer/emacs-buttercup/pull/217
(let ((load-path (cons "." load-path)))
Expand Down
26 changes: 26 additions & 0 deletions lisp/test/ecukes.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
;;; test/ecukes.el --- Run ecukes tests -*- lexical-binding: t; -*-

;;; Commentary:
;;
;; Command to run ecukes tests,
;;
;; $ eask ecukes
;;

;;; Code:

(let ((dir (file-name-directory (nth 1 (member "-scriptload" command-line-args)))))
(load (expand-file-name "_prepare.el"
(locate-dominating-file dir "_prepare.el"))
nil t))

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

;; Start Testing
(require 'ecukes)
(ecukes))

;;; test/ecukes.el ends here
3 changes: 2 additions & 1 deletion lisp/test/melpazoid.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
(eask-with-archives '("gnu" "melpa")
(eask-package-install 'package-lint)
(eask-package-install 'pkg-info))
;; Start test

;; Start Testing
(let* ((dirs (or (eask-args) `(,default-directory))))
(cond
;; Files found, do the action!
Expand Down

0 comments on commit 5f47b73

Please sign in to comment.