forked from paetzke/py-yapf.el
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.sh
executable file
·62 lines (46 loc) · 1.07 KB
/
tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash -e
TEST_FILE=/tmp/py-test-file.py
install_emacs24() {
sudo add-apt-repository ppa:cassou/emacs -y
sudo apt-get update -y
sudo apt-get install emacs24 -y
}
test_install_package() {
echo $FUNCNAME
emacs -nw py-yapf.el \
-f package-install-from-buffer \
-f kill-emacs
}
test_01() {
echo $FUNCNAME
rm $TEST_FILE || true
emacs --no-init-file -nw \
--load ./tests.el \
--load py-yapf.el \
./tests/01/before.py \
-f py-yapf-buffer \
-f write-test-file \
-f kill-emacs
diff $TEST_FILE ./tests/01/after.py
}
test_02() {
echo $FUNCNAME
rm $TEST_FILE || true
emacs --no-init-file -nw \
--load ./tests.el \
--load ./tests/02/init.el \
--load py-yapf.el \
./tests/02/before.py \
-f write-test-file \
-f kill-emacs
diff $TEST_FILE ./tests/02/after.py
}
main() {
if [ "$TRAVIS" = "true" ]; then
install_emacs24
test_install_package
fi
test_01
test_02
}
main