Skip to content

Commit 78817b4

Browse files
committed
Check some packages depending on haskell-mode
1 parent 268a598 commit 78817b4

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ env:
77
- TARGET=emacs24
88
- TARGET=emacs-snapshot
99
- TARGET=deploy-manual
10+
- TARGET=check-external
1011
global:
1112
- secure: "ejv1+ub/v+Hm/23fhp4zLAHT3HiCG+YdDHai57LDe4LfEZCeGz4i/6LazbPbwm58v2YuKvMcdNshebc1s4A293ARJryPyFfW/8kEe+3hQ+cDxunNdHfqcS8SyhcDG0mrv7dqiVAtMJqB8qZb0c161KeEM8nyhC0wyQ+EZ5qJnzM="
1213

1314
matrix:
1415
allow_failures:
1516
- env: TARGET=emacs-snapshot
17+
- env: TARGET=check-external
1618

1719
install: |
1820
case "$TARGET" in
@@ -29,6 +31,11 @@ install: |
2931
sudo apt-get update &&
3032
sudo apt-get install --no-install-suggests --no-install-recommends --force-yes texinfo emacs24-nox;
3133
;;
34+
check-external)
35+
sudo add-apt-repository -y ppa:andreas-h/emacs &&
36+
sudo apt-get update &&
37+
sudo apt-get install --no-install-suggests --no-install-recommends --force-yes emacs24;
38+
;;
3239
*)
3340
esac
3441
@@ -43,6 +50,9 @@ script: |
4350
deploy-manual)
4451
EMACS=emacs24 make deploy-manual;
4552
;;
53+
check-external)
54+
EMACS=emacs24 make check-external;
55+
;;
4656
*)
4757
esac
4858

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,8 @@ $(AUTOLOADS): $(ELFILES)
147147
-f batch-update-autoloads "."
148148
# check if autoloads will really load
149149
$(BATCH) -l "$@"
150+
151+
check-external : check-emacs-version $(AUTOLOADS)
152+
$(BATCH) -l tests/haskell-external.el \
153+
-f haskell-check-external-batch-and-exit
154+
@echo "external packages okay"

tests/haskell-external.el

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
;; haskell-check-external.el --- Test if packages depending on haskell-mode install okay -*- lexical-binding: t; -*-
2+
3+
(require 'package)
4+
(require 'bytecomp)
5+
6+
(defun haskell-check-external-batch-and-exit ()
7+
"Check if packages depending on haskell-mode bytecompile.
8+
9+
Haskell Mode should not break packages that depend on it and this
10+
function checks if officially released versions still compile."
11+
12+
(let ((byte-compile-error-on-warn t)
13+
;; where to install temporary packages
14+
(package-user-dir (concat command-line-default-directory "/external/elpa"))
15+
;; use haskell-mode directly from sources, it takes priority
16+
;; over haskell-mode in packages. note that this works from
17+
;; Emacs 24.4 onward, there is something wrong about this
18+
;; variable in Emacs 24.3
19+
(package-directory-list (list command-line-default-directory))
20+
;; packages depending on haskell-mode are in melpa
21+
(package-archives (cons '("melpa" . "http://melpa.milkbox.net/packages/") package-archives)))
22+
23+
(unwind-protect
24+
(progn
25+
(make-directory "external")
26+
27+
;; We aren't really able to depend on errors and warnings in
28+
;; bytecompilation as there are many packages that are very
29+
;; inconsistent about following elisp best practices.
30+
(package-initialize)
31+
(package-refresh-contents)
32+
(package-install 'flycheck-haskell)
33+
(package-install 'flycheck-stack)
34+
(package-install 'ghc)
35+
(package-install 'intero))
36+
(delete-directory "external" t))))

0 commit comments

Comments
 (0)