Bram Moolenaar | 46acad7 | 2023-06-11 19:04:18 +0100 | [diff] [blame] | 1 | # Portable Makefile for running syntax tests. |
| 2 | |
Christian Brabandt | 5682443 | 2024-02-28 21:24:25 +0100 | [diff] [blame] | 3 | # To run the test manually: |
| 4 | # ../../src/vim -u 'testdir/runtest.vim' --cmd 'breakadd func RunTest' |
| 5 | |
Bram Moolenaar | 1aa5f1c | 2023-06-22 21:57:51 +0100 | [diff] [blame] | 6 | # Override this if needed, the default assumes Vim was build in the src dir. |
| 7 | #VIMPROG = vim |
| 8 | VIMPROG = ../../src/vim |
Bram Moolenaar | 46acad7 | 2023-06-11 19:04:18 +0100 | [diff] [blame] | 9 | |
| 10 | # "runtime" relative to "runtime/syntax/testdir" |
| 11 | VIMRUNTIME = ../.. |
| 12 | |
| 13 | # Uncomment this line to use valgrind for memory leaks and extra warnings. |
| 14 | # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=45 --log-file=valgrind.$* |
| 15 | |
| 16 | # ENVVARS = LC_ALL=C LANG=C LANGUAGE=C |
Christian Brabandt | 627c950 | 2024-02-10 13:02:17 +0100 | [diff] [blame] | 17 | # Run the syntax tests with a C locale |
| 18 | ENVVARS = LC_ALL=C |
Bram Moolenaar | 46acad7 | 2023-06-11 19:04:18 +0100 | [diff] [blame] | 19 | |
K.Takata | d5b952a | 2023-06-13 22:44:57 +0100 | [diff] [blame] | 20 | RUN_VIMTEST = VIMRUNTIME=$(VIMRUNTIME) $(VALGRIND) $(ENVVARS) ../$(VIMPROG) -f $(GUI_FLAG) |
Bram Moolenaar | 46acad7 | 2023-06-11 19:04:18 +0100 | [diff] [blame] | 21 | |
Bram Moolenaar | 1aa5f1c | 2023-06-22 21:57:51 +0100 | [diff] [blame] | 22 | # Uncomment this line for debugging |
| 23 | # DEBUGLOG = --log testlog |
| 24 | |
Bram Moolenaar | 46acad7 | 2023-06-11 19:04:18 +0100 | [diff] [blame] | 25 | # Run the tests that didn't run yet or failed previously. |
| 26 | # If a test succeeds a testdir/done/{name} file will be written. |
| 27 | # If a test fails a testdir/failed/{name}.dump file will be written. |
Bram Moolenaar | 1aa5f1c | 2023-06-22 21:57:51 +0100 | [diff] [blame] | 28 | # Progress and error messages can be found in "testdir/messages". |
Bram Moolenaar | 46acad7 | 2023-06-11 19:04:18 +0100 | [diff] [blame] | 29 | test: |
| 30 | @# the "vimcmd" file is used by the screendump utils |
K.Takata | d5b952a | 2023-06-13 22:44:57 +0100 | [diff] [blame] | 31 | @echo "../$(VIMPROG)" > testdir/vimcmd |
Bram Moolenaar | 46acad7 | 2023-06-11 19:04:18 +0100 | [diff] [blame] | 32 | @echo "$(RUN_VIMTEST)" >> testdir/vimcmd |
Christian Brabandt | 627c950 | 2024-02-10 13:02:17 +0100 | [diff] [blame] | 33 | VIMRUNTIME=$(VIMRUNTIME) $(ENVVARS) $(VIMPROG) --clean --not-a-term $(DEBUGLOG) -u testdir/runtest.vim |
Bram Moolenaar | 10c1dbc | 2023-06-23 19:37:19 +0100 | [diff] [blame] | 34 | @# FIXME: Temporarily show the whole file to find out what goes wrong |
Dominique Pellé | 99c3849 | 2023-09-24 16:09:31 +0200 | [diff] [blame] | 35 | @#if [ -f testdir/messages ]; then tail -n 6 testdir/messages; fi |
| 36 | @if [ -f testdir/messages ]; then cat testdir/messages; fi |
Bram Moolenaar | 46acad7 | 2023-06-11 19:04:18 +0100 | [diff] [blame] | 37 | |
| 38 | |
| 39 | clean testclean: |
Christian Brabandt | 627c950 | 2024-02-10 13:02:17 +0100 | [diff] [blame] | 40 | rm -f testdir/failed/* testdir/done/* testdir/vimcmd testdir/messages testdir/Xtestscript |