Add make target to start test runner
This commit is contained in:
parent
703994420c
commit
1afcb6f37a
5 changed files with 21 additions and 8 deletions
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
|
@ -22,5 +22,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.emacs_version }}
|
version: ${{ matrix.emacs_version }}
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Run a one-line script
|
- name: Install taskwarrior package
|
||||||
run: echo Hello, world!
|
run: sudo apt-get install -y taskwarrior
|
||||||
|
- name: Run ERT test suite
|
||||||
|
run: make test
|
||||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
.task
|
.task
|
||||||
|
dash.el
|
||||||
|
transient.el
|
11
Makefile
11
Makefile
|
@ -1,4 +1,13 @@
|
||||||
.PHONY: test-data
|
|
||||||
|
|
||||||
|
.PHONY: test-data
|
||||||
test-data: ## Generate some example tasks
|
test-data: ## Generate some example tasks
|
||||||
for n in $$(seq 10); do task add "Example task $${n}"; done
|
for n in $$(seq 10); do task add "Example task $${n}"; done
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
|
test: fetch-deps ## Run ERT test suite
|
||||||
|
emacs -batch -l dash.el -l transient.el -l taskwarrior.el -l taskwarrior-test.el -f ert-run-tests-batch-and-exit
|
||||||
|
|
||||||
|
.PHONY: fetch-deps
|
||||||
|
fetch-deps: ## Fetch required dependencies
|
||||||
|
curl -fsSkL --retry 9 --retry-delay 9 -O "https://raw.githubusercontent.com/magit/transient/master/lisp/transient.el"
|
||||||
|
curl -fsSkL --retry 9 --retry-delay 9 -O "https://raw.githubusercontent.com/magnars/dash.el/master/dash.el"
|
||||||
|
|
|
@ -2,18 +2,16 @@
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;; Run standalone with this,
|
;; Run through make target `m̀ake test`
|
||||||
;; emacs -batch -L . -l taskwarrior-test.el -f ert-run-tests-batch
|
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'ert)
|
(require 'ert)
|
||||||
|
|
||||||
|
|
||||||
(ert-deftest taskwarrior-add-task-test ()
|
(ert-deftest taskwarrior-add-task-test ()
|
||||||
"Ensure that special characters such as quotes and parens are properly escaped when adding new tasks"
|
"Ensure that special characters such as quotes and parens are properly escaped when adding new tasks"
|
||||||
(let* ((task-id (taskwarrior--add "project:ert +emacs \"Write test suite for taskwarrior.el (using ERT)\""))
|
(let* ((task-id (taskwarrior--add "project:ert +emacs \"Write test suite for taskwarrior.el (using ERT)\""))
|
||||||
(task (taskwarrior-export-task task-id)))
|
(task (taskwarrior-export-task task-id)))
|
||||||
(should (string= (alist-get 'project task) "ert"))
|
(should (string= (alist-get 'project task) "ert"))
|
||||||
(should (string= (aref (alist-get 'tags task) 0) "emacs"))
|
(should (string= (aref (alist-get 'tags task) 0) "emacs"))
|
||||||
(should (string= (alist-get 'description task) "Write test suite for taskwarrior.el (using ERT)")))
|
(should (string= (alist-get 'description task) "Write test suite for taskwarrior.el (using ERT)"))))
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
;; TODO: Restore position after taskwarrior-update-buffer is called
|
;; TODO: Restore position after taskwarrior-update-buffer is called
|
||||||
|
|
||||||
(require 'json)
|
(require 'json)
|
||||||
|
(require 'dash)
|
||||||
|
(require 'transient)
|
||||||
|
|
||||||
(defgroup taskwarrior nil "An emacs frontend to taskwarrior.")
|
(defgroup taskwarrior nil "An emacs frontend to taskwarrior.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue