Skip to content

Commit ebb37cf

Browse files
committed
Use Cask to trigger tests (and solve dependencies)
Follow up from the discussion #370 (comment) Use: - Install Cask - http://cask.readthedocs.org/en/latest/guide/installation.html ```sh curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python ``` - Trigger tests: ``` make check ``` This will use cask only for the tests target.
1 parent e838266 commit ebb37cf

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
haskell-mode-autoloads.el
44
haskell-mode.info
55
haskell-mode.tmp.texi
6-
dir
6+
dir
7+
/.cask/

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ env:
44
matrix:
55
- EMACS=emacs24
66
- EMACS=emacs-snapshot
7+
global:
8+
- PATH=$HOME/.cask/bin:$PATH
79

810
matrix:
911
allow_failures:
@@ -22,6 +24,9 @@ install:
2224
sudo apt-get install -qq emacs-snapshot &&
2325
sudo apt-get install -qq emacs-snapshot-el emacs-snapshot-gtk;
2426
fi
27+
- make deps
28+
- cask --version
29+
- cask
2530

2631
script:
2732
lsb_release -a && $EMACS --version && make EMACS=$EMACS check

Cask

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(source gnu)
2+
(source melpa)
3+
4+
(package-file "haskell-mode.el")
5+
6+
(files "*.el")
7+
8+
(development
9+
(depends-on "ert")
10+
(depends-on "ert-expectations")
11+
(depends-on "el-mock"))

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ ELCHECKS=$(addprefix check-, $(ELFILES:.el=))
5454

5555
.PHONY: all compile info clean check $(ELCHECKS) elpa package
5656

57+
deps:
58+
curl -fsSkL https://raw.github.com/cask/cask/master/go | python
59+
5760
all: compile $(AUTOLOADS) info
5861

5962
compile: $(ELCFILES)
@@ -67,7 +70,7 @@ $(ELCHECKS): check-%: %.el
6770
@if [ -f "$(<:%.el=tests/%-tests.el)" ]; then \
6871
if $(BATCH) --eval "(require 'ert)" 2> /dev/null; then \
6972
echo; \
70-
$(BATCH) -l "$(<:%.el=tests/%-tests.el)" -f ert-run-tests-batch-and-exit; \
73+
cask exec $(BATCH) -l "$(<:%.el=tests/%-tests.el)" -f ert-run-tests-batch-and-exit; \
7174
else \
7275
echo "ERT not available, skipping unit tests"; \
7376
fi; \

haskell-mode.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
;; 2003 Dave Love <[email protected]>
1111
;; Keywords: faces files Haskell
1212
;; URL: https://github.com/haskell/haskell-mode
13+
;; Version: 13.07
1314

1415
;; This file is not part of GNU Emacs.
1516

tests/haskell-process-tests.el

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
(require 'ert)
66
(require 'haskell-process)
77

8-
;; HACK how to install deps in haskell-mode
9-
(progn (require 'package)
10-
(package-initialize)
11-
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
12-
(package-refresh-contents)
13-
(package-install 'el-mock))
14-
8+
(eval-when-compile (require 'cl)) ;; for tests with mock to pass...
159
(require 'el-mock)
1610

1711
(ert-deftest haskell-process-stringify-cmd-no-arg ()

0 commit comments

Comments
 (0)