2014-01-31 06:39:15 -07:00
|
|
|
#
|
|
|
|
# Makefile to run all tests for Vim
|
|
|
|
#
|
|
|
|
|
2014-04-05 05:26:17 -07:00
|
|
|
export SHELL := sh
|
|
|
|
|
2014-05-12 06:52:30 -07:00
|
|
|
VIMPROG := ../../../build/bin/nvim
|
2014-08-13 12:31:29 -07:00
|
|
|
SCRIPTSOURCE := ../../../runtime
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2015-06-11 04:26:56 -07:00
|
|
|
SCRIPTS := test_eval.out \
|
2015-03-18 17:31:09 -07:00
|
|
|
test8.out test10.out \
|
|
|
|
test11.out test12.out test13.out test14.out \
|
|
|
|
test17.out \
|
|
|
|
test24.out \
|
2015-07-14 05:45:09 -07:00
|
|
|
test30.out \
|
2015-05-24 13:04:51 -07:00
|
|
|
test32.out test34.out \
|
2015-04-07 03:55:58 -07:00
|
|
|
test36.out test37.out test39.out test40.out \
|
2015-07-14 05:45:09 -07:00
|
|
|
test42.out test45.out \
|
|
|
|
test47.out test48.out test49.out \
|
2015-03-18 17:31:09 -07:00
|
|
|
test52.out test53.out test55.out \
|
2015-07-14 05:45:09 -07:00
|
|
|
test64.out \
|
2015-04-05 06:32:08 -07:00
|
|
|
test68.out test69.out \
|
2015-07-14 05:45:09 -07:00
|
|
|
test73.out \
|
2015-07-10 03:12:09 -07:00
|
|
|
test79.out \
|
2015-05-15 10:03:49 -07:00
|
|
|
test83.out \
|
2015-07-21 17:02:23 -07:00
|
|
|
test88.out \
|
2015-03-18 17:31:09 -07:00
|
|
|
test_listlbr.out \
|
2015-01-10 16:27:17 -07:00
|
|
|
test_breakindent.out \
|
2015-08-19 18:53:52 -07:00
|
|
|
test_charsearch.out \
|
2015-01-15 16:18:15 -07:00
|
|
|
test_close_count.out \
|
2015-01-31 16:10:52 -07:00
|
|
|
test_command_count.out \
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2016-01-10 07:46:04 -07:00
|
|
|
NEW_TESTS = test_cdo.res
|
2015-12-12 20:19:54 -07:00
|
|
|
|
2014-02-26 12:16:54 -07:00
|
|
|
SCRIPTS_GUI := test16.out
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2014-04-05 05:26:17 -07:00
|
|
|
|
|
|
|
ifdef VALGRIND_GDB
|
2014-04-25 01:11:26 -07:00
|
|
|
VGDB := --vgdb=yes \
|
|
|
|
--vgdb-error=0
|
2014-04-05 05:26:17 -07:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef USE_VALGRIND
|
2014-04-25 01:11:26 -07:00
|
|
|
VALGRIND_TOOL := --tool=memcheck \
|
|
|
|
--leak-check=yes \
|
|
|
|
--track-origins=yes
|
|
|
|
# VALGRIND_TOOL := exp-sgcheck
|
2014-11-22 04:54:36 -07:00
|
|
|
TOOL := valgrind -q \
|
|
|
|
-q \
|
|
|
|
$(VALGRIND_TOOL) \
|
|
|
|
--suppressions=../../../.valgrind.supp \
|
|
|
|
--error-exitcode=123 \
|
|
|
|
--log-file=valgrind.\%p.$* \
|
|
|
|
$(VGDB) \
|
2014-04-30 19:01:27 -07:00
|
|
|
--trace-children=yes
|
2014-04-05 05:26:17 -07:00
|
|
|
else
|
2014-04-25 01:11:26 -07:00
|
|
|
ifdef USE_GDB
|
|
|
|
TOOL = gdb --args
|
|
|
|
endif
|
2014-02-26 11:48:26 -07:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef TESTNUM
|
2014-04-25 01:11:26 -07:00
|
|
|
SCRIPTS := test$(TESTNUM).out
|
2014-02-26 11:48:26 -07:00
|
|
|
endif
|
|
|
|
|
2015-12-12 20:19:54 -07:00
|
|
|
nongui: nolog $(SCRIPTS) newtests report
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2015-12-12 20:19:54 -07:00
|
|
|
gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) newtests report
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2014-03-27 09:35:36 -07:00
|
|
|
.gdbinit:
|
|
|
|
echo 'set $$_exitcode = -1\nrun\nif $$_exitcode != -1\n quit\nend' > .gdbinit
|
|
|
|
|
2014-01-31 06:39:15 -07:00
|
|
|
report:
|
|
|
|
@echo
|
|
|
|
@echo 'Test results:'
|
2014-04-25 01:11:26 -07:00
|
|
|
@/bin/sh -c "if test -f test.log; then \
|
|
|
|
cat test.log; \
|
|
|
|
echo TEST FAILURE; \
|
|
|
|
exit 1; \
|
|
|
|
else \
|
|
|
|
echo ALL DONE; \
|
|
|
|
fi"
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2014-06-14 08:41:29 -07:00
|
|
|
test1.out: $(VIMPROG)
|
|
|
|
|
|
|
|
$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) test1.out
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2014-04-25 01:11:26 -07:00
|
|
|
RM_ON_RUN := test.out X* viminfo
|
2015-04-05 06:44:30 -07:00
|
|
|
RM_ON_START := tiny.vim small.vim mbyte.vim test.ok
|
2014-12-15 10:47:16 -07:00
|
|
|
RUN_VIM := VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(VIMPROG) -u unix.vim -U NONE -i viminfo --noplugin -s dotest.in
|
2014-01-31 06:39:15 -07:00
|
|
|
|
|
|
|
clean:
|
2014-04-25 01:11:26 -07:00
|
|
|
-rm -rf *.out \
|
|
|
|
*.failed \
|
2015-12-12 20:19:54 -07:00
|
|
|
*.res \
|
2014-04-25 01:11:26 -07:00
|
|
|
*.rej \
|
|
|
|
*.orig \
|
|
|
|
test.log \
|
|
|
|
$(RM_ON_RUN) \
|
|
|
|
$(RM_ON_START) \
|
|
|
|
valgrind.* \
|
|
|
|
.*.swp \
|
2015-01-23 12:08:20 -07:00
|
|
|
.*.swo \
|
|
|
|
del
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2014-03-27 09:35:36 -07:00
|
|
|
test1.out: .gdbinit test1.in
|
2014-01-31 06:39:15 -07:00
|
|
|
-rm -rf $*.failed $(RM_ON_RUN) $(RM_ON_START) wrongtermsize
|
|
|
|
$(RUN_VIM) $*.in
|
2014-04-25 01:11:26 -07:00
|
|
|
@/bin/sh -c "if test -e wrongtermsize; then \
|
|
|
|
echo; \
|
|
|
|
echo test1 FAILED - terminal size must be 80x24 or larger; \
|
|
|
|
echo; exit 1; \
|
|
|
|
elif diff test.out $*.ok; then \
|
|
|
|
mv -f test.out $*.out; \
|
|
|
|
else \
|
|
|
|
echo; \
|
|
|
|
echo test1 FAILED - Something basic is wrong; \
|
|
|
|
echo; \
|
|
|
|
exit 1; \
|
|
|
|
fi"
|
2014-01-31 06:39:15 -07:00
|
|
|
-rm -rf X* viminfo
|
|
|
|
|
2014-04-01 21:10:17 -07:00
|
|
|
%.out: %.in .gdbinit
|
2014-01-31 06:39:15 -07:00
|
|
|
-rm -rf $*.failed test.ok $(RM_ON_RUN)
|
|
|
|
cp $*.ok test.ok
|
|
|
|
# Sleep a moment to avoid that the xterm title is messed up.
|
|
|
|
# 200 msec is sufficient, but only modern sleep supports a fraction of
|
|
|
|
# a second, fall back to a second if it fails.
|
|
|
|
@-/bin/sh -c "sleep .2 > /dev/null 2>&1 || sleep 1"
|
2014-03-07 07:58:06 -07:00
|
|
|
$(RUN_VIM) $*.in
|
2014-01-31 06:39:15 -07:00
|
|
|
|
|
|
|
# Check if the test.out file matches test.ok.
|
2014-04-25 01:11:26 -07:00
|
|
|
@/bin/sh -c "if test -f test.out; then \
|
|
|
|
if diff test.out $*.ok; then \
|
|
|
|
mv -f test.out $*.out; \
|
|
|
|
else \
|
|
|
|
echo $* FAILED >> test.log; \
|
|
|
|
mv -f test.out $*.failed; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo $* NO OUTPUT >>test.log; \
|
|
|
|
fi"
|
|
|
|
@/bin/sh -c "if test -f valgrind; then \
|
|
|
|
mv -f valgrind valgrind.$*; \
|
|
|
|
fi"
|
2014-01-31 06:39:15 -07:00
|
|
|
-rm -rf X* test.ok viminfo
|
|
|
|
|
|
|
|
test49.out: test49.vim
|
|
|
|
|
|
|
|
nolog:
|
|
|
|
-rm -f test.log
|
2015-12-12 20:19:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
# New style of tests uses Vim script with assert calls. These are easier
|
|
|
|
# to write and a lot easier to read and debug.
|
|
|
|
# Limitation: Only works with the +eval feature.
|
|
|
|
RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin
|
|
|
|
|
2016-01-09 17:10:17 -07:00
|
|
|
newtests: newtestssilent
|
|
|
|
@/bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then \
|
|
|
|
cat messages && cat test.log; \
|
2016-01-10 13:05:11 -07:00
|
|
|
fi"
|
2016-01-09 17:10:17 -07:00
|
|
|
|
|
|
|
newtestssilent: $(NEW_TESTS)
|
2015-12-12 20:19:54 -07:00
|
|
|
|
|
|
|
%.res: %.vim .gdbinit
|
2016-01-10 07:46:04 -07:00
|
|
|
$(RUN_VIMTEST) -S runtest.vim $*.vim
|