Skip to content

Commit 351cc91

Browse files
committed
Merge pull request #16 from MicahChalmer/add-travis
Add travis config (and make tests runnable on emacs 23)
2 parents fd92bfd + 8a69f69 commit 351cc91

File tree

2 files changed

+53
-9
lines changed

2 files changed

+53
-9
lines changed

.travis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
language: generic
2+
3+
env:
4+
matrix:
5+
- EMACS=emacs23
6+
- EMACS=emacs24
7+
- EMACS=emacs-snapshot
8+
9+
install:
10+
- if [ "$EMACS" = 'emacs23' ]; then
11+
sudo apt-get -qq update &&
12+
sudo apt-get -qq -f install &&
13+
sudo apt-get -qq install emacs23-gtk emacs23-el;
14+
fi
15+
- if [ "$EMACS" = 'emacs24' ]; then
16+
sudo add-apt-repository -y ppa:cassou/emacs &&
17+
sudo apt-get -qq update &&
18+
sudo apt-get -qq -f install &&
19+
sudo apt-get -qq install emacs24 emacs24-el;
20+
fi
21+
- if [ "$EMACS" = 'emacs-snapshot' ]; then
22+
sudo add-apt-repository -y ppa:ubuntu-elisp/ppa &&
23+
sudo apt-get -qq update &&
24+
sudo apt-get -qq -f install &&
25+
sudo apt-get -qq install emacs-snapshot &&
26+
sudo apt-get -qq install emacs-snapshot-el;
27+
fi
28+
29+
# Emacs 23 does not come with ERT. Download it and have emacs find it
30+
before_script:
31+
- if [ "$EMACS" = 'emacs23' ]; then
32+
curl -Os https://raw.githubusercontent.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el &&
33+
export EMACSLOADPATH=$(emacs -batch -eval "(princ (mapconcat 'identity load-path \":\"))") &&
34+
export EMACSLOADPATH="$EMACSLOADPATH:$PWD";
35+
fi
36+
37+
script:
38+
- ./run_rust_emacs_tests.sh
39+
40+
notifications:
41+
email: false

rust-mode-tests.el

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,10 @@ fn indented_already() {
628628
POS-SYMBOL is a symbol found in `rust-test-positions-alist'.
629629
Convert the line-column information from that list into a buffer position value."
630630
(interactive "P")
631-
(pcase-let ((`(,line ,column) (cadr (assoc pos-symbol rust-test-positions-alist))))
631+
(let* (
632+
(line-and-column (cadr (assoc pos-symbol rust-test-positions-alist)))
633+
(line (nth 0 line-and-column))
634+
(column (nth 1 line-and-column)))
632635
(save-excursion
633636
(goto-line line)
634637
(move-to-column column)
@@ -856,14 +859,14 @@ All positions are position symbols found in `rust-test-positions-alist'."
856859
(defun rust-test-group-str-by-face (str)
857860
"Fontify `STR' in rust-mode and group it by face, returning a
858861
list of substrings of `STR' each followed by its face."
859-
(cl-loop with fontified = (rust-test-fontify-string str)
860-
for start = 0 then end
861-
while start
862-
for end = (next-single-property-change start 'face fontified)
863-
for prop = (get-text-property start 'face fontified)
864-
for text = (substring-no-properties fontified start end)
865-
if prop
866-
append (list text prop)))
862+
(loop with fontified = (rust-test-fontify-string str)
863+
for start = 0 then end
864+
while start
865+
for end = (next-single-property-change start 'face fontified)
866+
for prop = (get-text-property start 'face fontified)
867+
for text = (substring-no-properties fontified start end)
868+
if prop
869+
append (list text prop)))
867870

868871
(defun rust-test-font-lock (source face-groups)
869872
"Test that `SOURCE' fontifies to the expected `FACE-GROUPS'"

0 commit comments

Comments
 (0)