Skip to content

Commit 8d32d7d

Browse files
committed
Add Cask to deal with dev/runtime 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. *Beware* emacs-23 is not supported by Cask.
1 parent 07bf9cd commit 8d32d7d

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ haskell-mode-autoloads.el
44
haskell-mode.info
55
haskell-mode.tmp.texi
66
dir
7+
/.cask/

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ env:
55
- EMACS=emacs23
66
- EMACS=emacs24
77
- EMACS=emacs-snapshot
8+
global:
9+
- PATH=$HOME/.cask/bin:$PATH
810

911
matrix:
1012
allow_failures:
@@ -27,6 +29,9 @@ install:
2729
sudo apt-get install -qq emacs-snapshot &&
2830
sudo apt-get install -qq emacs-snapshot-el;
2931
fi
32+
- make deps
33+
- cask --version
34+
- cask
3035

3136
script:
3237
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
@@ -69,14 +69,17 @@ ELCHECKS=$(addprefix check-, $(ELFILES:.el=))
6969

7070
.PHONY: all compile info clean check $(ELCHECKS) elpa package
7171

72+
deps:
73+
curl -fsSkL https://raw.github.com/cask/cask/master/go | python
74+
7275
all: compile $(AUTOLOADS) info
7376

7477
compile: $(ELCFILES)
7578

7679
$(ELCHECKS): check-%: %.el %.elc
7780
@$(BATCH) --eval '(when (check-declare-file "$*.el") (error "check-declare failed"))'
7881
@if [ -f "$(<:%.el=tests/%-tests.el)" ]; then \
79-
$(BATCH) -l "$(<:%.el=tests/%-tests.el)" -f ert-run-tests-batch-and-exit; \
82+
cask exec $(BATCH) -l "$(<:%.el=tests/%-tests.el)" -f ert-run-tests-batch-and-exit; \
8083
fi
8184
@echo "--"
8285

haskell-mode.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
;; Keywords: faces files Haskell
1212
;; Version: 13.10
1313
;; URL: https://github.com/haskell/haskell-mode
14+
;; Version: 13.07
1415

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

tests/haskell-process-tests.el

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,6 @@
66
(require 'haskell-process)
77

88
(eval-when-compile (require 'cl)) ;; for tests with mock to pass...
9-
10-
(progn ;; HACK install package.el including for emacs-23.3, then install external el-mock dependency
11-
(when (version< emacs-version "24")
12-
(with-current-buffer (url-retrieve-synchronously "http://git.savannah.gnu.org/gitweb/?p=emacs.git;a=blob_plain;hb=ba08b24186711eaeb3748f3d1f23e2c2d9ed0d09;f=lisp/emacs-lisp/package.el")
13-
(save-excursion
14-
(goto-char (point-min))
15-
(kill-line 8)
16-
(eval-buffer))))
17-
(require 'package)
18-
(package-initialize)
19-
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
20-
(package-refresh-contents)
21-
(package-install 'el-mock))
22-
239
(require 'el-mock)
2410

2511
(ert-deftest haskell-process-wrapper-command-function-identity ()

0 commit comments

Comments
 (0)