Skip to content

Commit 4ef7b3a

Browse files
committed
Add new command buttercup
1 parent 33dd48c commit 4ef7b3a

3 files changed

Lines changed: 68 additions & 0 deletions

File tree

cmds/lint/buttercup.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright (C) 2022 Jen-Chieh Shen
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 3, or (at your option)
7+
* any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with GNU Emacs; see the file COPYING. If not, write to the
16+
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301, USA.
18+
*/
19+
20+
"use strict";
21+
22+
exports.command = ['buttercup [files..]'];
23+
exports.desc = 'run buttercup tests';
24+
exports.builder = {
25+
files: {
26+
description: 'files you want buttercup to run on',
27+
requiresArg: false,
28+
type: 'array',
29+
},
30+
};
31+
32+
exports.handler = async (argv) => {
33+
await UTIL.e_call(argv, 'lint/buttercup', argv.files);
34+
};

docs/content/en/Getting Started/Commands and options.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,12 @@ $ eask [GLOBAL-OPTIONS] ert [FILES..]
335335
$ eask [GLOBAL-OPTIONS] ert-runner [FILES..]
336336
```
337337

338+
## 🔍 eask buttercup
339+
340+
```sh
341+
$ eask [GLOBAL-OPTIONS] buttercup
342+
```
343+
338344
# 🚩 Utilities
339345

340346
## 🔍 eask upgrade-eask

lisp/lint/buttercup.el

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
;;; buttercup.el --- Run buttercup tests -*- lexical-binding: t; -*-
2+
3+
;;; Commentary:
4+
;;
5+
;; Command to run buttercup tests,
6+
;;
7+
;; $ eask buttercup [files..]
8+
;;
9+
;;
10+
;; Initialization options:
11+
;;
12+
;; [files..] specify files to run ert tests
13+
;;
14+
15+
;;; Code:
16+
17+
(load (expand-file-name
18+
"../_prepare.el"
19+
(file-name-directory (nth 1 (member "-scriptload" command-line-args))))
20+
nil t)
21+
22+
(eask-start
23+
(eask-with-archives "melpa"
24+
(eask-package-install 'buttercup))
25+
(require 'buttercup)
26+
(buttercup-run-discover))
27+
28+
;;; buttercup.el ends here

0 commit comments

Comments
 (0)