Mercurial > vim
annotate src/testdir/Makefile @ 7354:81dc9e30aad6 v7.4.982
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 28 16:01:26 2015 +0100
patch 7.4.982
Problem: Keeping the list of tests updated is a hassle.
Solution: Move the list to a separate file, so that it only needs to be
udpated in one place.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 28 Dec 2015 16:15:05 +0100 |
parents | 5ac8ee7bf4ff |
children | f0eb9aa9eb32 |
rev | line source |
---|---|
7 | 1 # |
1326 | 2 # Makefile to run all tests for Vim |
7 | 3 # |
4 | |
7313
2062247be2d0
commit https://github.com/vim/vim/commit/3f12a2421bda43a4e48c822541b75f72ee11125a
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
5 # Use console or GUI. |
7 | 6 VIMPROG = ../vim |
7313
2062247be2d0
commit https://github.com/vim/vim/commit/3f12a2421bda43a4e48c822541b75f72ee11125a
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
7 # VIMPROG = ../gvim |
2062247be2d0
commit https://github.com/vim/vim/commit/3f12a2421bda43a4e48c822541b75f72ee11125a
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
8 |
5774 | 9 SCRIPTSOURCE = ../../runtime |
7 | 10 |
1920 | 11 # Uncomment this line to use valgrind for memory leaks and extra warnings. |
12 # The output goes into a file "valgrind.testN" | |
13 # Vim should be compiled with EXITFREE to avoid false warnings. | |
14 # This will make testing about 10 times as slow. | |
15 # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$* | |
1357 | 16 |
2607 | 17 |
7354
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
18 # The list of tests is common to all systems. |
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
19 # This defines NEW_TESTS, SCRIPTS_ALL, SCRIPTS_MORE* and SCRIPTS_GUI. |
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
20 include Make_all.mak |
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
21 |
7 | 22 |
7354
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
23 SCRIPTS = $(SCRIPTS_ALL) \ |
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
24 $(SCRIPTS_MORE1) \ |
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
25 $(SCRIPTS_MORE2) \ |
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
26 $(SCRIPTS_MORE3) \ |
81dc9e30aad6
commit https://github.com/vim/vim/commit/7b6156f4cd4027b664a916ba546e9b05d4c49e11
Christian Brabandt <cb@256bit.org>
parents:
7350
diff
changeset
|
27 $(SCRIPTS_MORE4) |
7 | 28 |
6328 | 29 SCRIPTS_BENCH = bench_re_freeze.out |
30 | |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
31 .SUFFIXES: .in .out .res .vim |
7 | 32 |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
33 nongui: nolog $(SCRIPTS) newtests report |
1717 | 34 |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
35 gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) newtests report |
7 | 36 |
6328 | 37 benchmark: $(SCRIPTS_BENCH) |
38 | |
1717 | 39 report: |
7 | 40 @echo |
1717 | 41 @echo 'Test results:' |
42 @/bin/sh -c "if test -f test.log; \ | |
43 then cat test.log; echo TEST FAILURE; exit 1; \ | |
44 else echo ALL DONE; \ | |
45 fi" | |
7 | 46 |
7313
2062247be2d0
commit https://github.com/vim/vim/commit/3f12a2421bda43a4e48c822541b75f72ee11125a
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
47 $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS): $(VIMPROG) |
7 | 48 |
3992 | 49 RM_ON_RUN = test.out X* viminfo |
6328 | 50 RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmark.out |
7313
2062247be2d0
commit https://github.com/vim/vim/commit/3f12a2421bda43a4e48c822541b75f72ee11125a
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
51 RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim -U NONE --noplugin -s dotest.in |
3992 | 52 |
7 | 53 clean: |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
54 -rm -rf *.out *.failed *.res *.rej *.orig test.log $(RM_ON_RUN) $(RM_ON_START) valgrind.* |
7 | 55 |
56 test1.out: test1.in | |
5363 | 57 -rm -rf $*.failed $(RM_ON_RUN) $(RM_ON_START) wrongtermsize |
3992 | 58 $(RUN_VIM) $*.in |
5702 | 59 @/bin/sh -c "if test -f wrongtermsize; \ |
5363 | 60 then echo; \ |
61 echo test1 FAILED - terminal size must be 80x24 or larger; \ | |
62 echo; exit 1; \ | |
63 elif diff test.out $*.ok; \ | |
7 | 64 then mv -f test.out $*.out; \ |
65 else echo; \ | |
66 echo test1 FAILED - Something basic is wrong; \ | |
67 echo; exit 1; fi" | |
68 -rm -rf X* viminfo | |
69 | |
70 .in.out: | |
3992 | 71 -rm -rf $*.failed test.ok $(RM_ON_RUN) |
7 | 72 cp $*.ok test.ok |
4313 | 73 # Sleep a moment to avoid that the xterm title is messed up. |
74 # 200 msec is sufficient, but only modern sleep supports a fraction of | |
75 # a second, fall back to a second if it fails. | |
76 @-/bin/sh -c "sleep .2 > /dev/null 2>&1 || sleep 1" | |
3992 | 77 -$(RUN_VIM) $*.in |
78 | |
79 # For flaky tests retry one time. | |
80 @/bin/sh -c "if test -f test.out -a $* = test61; then \ | |
81 if diff test.out $*.ok; \ | |
82 then echo flaky test ok first time; \ | |
83 else rm -rf $*.failed $(RM_ON_RUN); \ | |
84 $(RUN_VIM) $*.in; \ | |
85 fi \ | |
86 fi" | |
87 | |
88 # Check if the test.out file matches test.ok. | |
4444 | 89 @/bin/sh -c "if test -f test.out; then \ |
169 | 90 if diff test.out $*.ok; \ |
91 then mv -f test.out $*.out; \ | |
92 else echo $* FAILED >>test.log; mv -f test.out $*.failed; \ | |
93 fi \ | |
94 else echo $* NO OUTPUT >>test.log; \ | |
7 | 95 fi" |
4444 | 96 @/bin/sh -c "if test -f valgrind; then\ |
97 mv -f valgrind valgrind.$*; \ | |
98 fi" | |
3855 | 99 -rm -rf X* test.ok viminfo |
7 | 100 |
6328 | 101 bench_re_freeze.out: bench_re_freeze.vim |
102 -rm -rf benchmark.out $(RM_ON_RUN) | |
103 # Sleep a moment to avoid that the xterm title is messed up. | |
104 # 200 msec is sufficient, but only modern sleep supports a fraction of | |
105 # a second, fall back to a second if it fails. | |
106 @-/bin/sh -c "sleep .2 > /dev/null 2>&1 || sleep 1" | |
107 -$(RUN_VIM) $*.in | |
108 @/bin/sh -c "if test -f benchmark.out; then cat benchmark.out; fi" | |
109 | |
7 | 110 nolog: |
1717 | 111 -rm -f test.log |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
112 |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
113 |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
114 # New style of tests uses Vim script with assert calls. These are easier |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
115 # to write and a lot easier to read and debug. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
116 # Limitation: Only works with the +eval feature. |
7313
2062247be2d0
commit https://github.com/vim/vim/commit/3f12a2421bda43a4e48c822541b75f72ee11125a
Christian Brabandt <cb@256bit.org>
parents:
7293
diff
changeset
|
117 RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim -U NONE --noplugin |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
118 |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
119 newtests: $(NEW_TESTS) |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
120 |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
7275
diff
changeset
|
121 .vim.res: |
7350
5ac8ee7bf4ff
commit https://github.com/vim/vim/commit/57d7971b5f1621071176eea81cdb0d1fc50c925d
Christian Brabandt <cb@256bit.org>
parents:
7313
diff
changeset
|
122 $(RUN_VIMTEST) -S runtest.vim $*.vim |