Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | # |
Bram Moolenaar | 6839272 | 2010-07-30 22:04:17 +0200 | [diff] [blame] | 2 | # Makefile to run all tests for Vim, on Dos-like machines. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 3 | # |
| 4 | # Requires a set of Unix tools: echo, diff, etc. |
| 5 | |
| 6 | VIMPROG = ..\\vim |
| 7 | |
| 8 | # Omitted: |
| 9 | # test2 "\\tmp" doesn't work. |
| 10 | # test10 'errorformat' is different |
| 11 | # test12 can't unlink a swap file |
| 12 | # test25 uses symbolic link |
| 13 | # test27 can't edit file with "*" in file name |
Bram Moolenaar | ee0ee2a | 2013-07-03 21:19:07 +0200 | [diff] [blame] | 14 | # test97 \{ and \$ are not escaped characters. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 15 | |
| 16 | SCRIPTS16 = test1.out test19.out test20.out test22.out \ |
| 17 | test23.out test24.out test28.out test29.out \ |
| 18 | test35.out test36.out test43.out \ |
| 19 | test44.out test45.out test46.out test47.out \ |
Bram Moolenaar | a7fc010 | 2005-05-18 22:17:12 +0000 | [diff] [blame] | 20 | test48.out test51.out test53.out test54.out \ |
Bram Moolenaar | 0ce33f3 | 2005-12-23 22:16:03 +0000 | [diff] [blame] | 21 | test55.out test56.out test57.out test58.out test59.out \ |
Bram Moolenaar | 9c03978 | 2007-08-14 15:55:42 +0000 | [diff] [blame] | 22 | test60.out test61.out test62.out test63.out test64.out |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 23 | |
| 24 | SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ |
| 25 | test8.out test9.out test11.out test13.out test14.out \ |
| 26 | test15.out test17.out test18.out test21.out test26.out \ |
| 27 | test30.out test31.out test32.out test33.out test34.out \ |
| 28 | test37.out test38.out test39.out test40.out test41.out \ |
Bram Moolenaar | f11021b | 2009-11-17 16:57:14 +0000 | [diff] [blame] | 29 | test42.out test52.out test65.out test66.out test67.out \ |
Bram Moolenaar | 680eeca | 2010-10-20 17:44:42 +0200 | [diff] [blame] | 30 | test68.out test69.out test71.out test72.out test73.out \ |
Bram Moolenaar | 978287b | 2011-06-19 04:32:15 +0200 | [diff] [blame] | 31 | test74.out test75.out test76.out test77.out test78.out \ |
Bram Moolenaar | 913077c | 2012-03-28 19:59:04 +0200 | [diff] [blame] | 32 | test79.out test80.out test81.out test82.out test83.out \ |
Bram Moolenaar | f4e5e86 | 2013-02-13 15:44:26 +0100 | [diff] [blame] | 33 | test84.out test85.out test86.out test87.out test88.out \ |
Bram Moolenaar | e3e6e57 | 2013-04-12 13:45:02 +0200 | [diff] [blame] | 34 | test89.out test90.out test91.out test92.out test93.out \ |
Bram Moolenaar | c1c023e | 2013-11-07 03:26:06 +0100 | [diff] [blame] | 35 | test94.out test95.out test96.out test98.out test99.out \ |
Bram Moolenaar | 26df092 | 2014-02-23 23:39:13 +0100 | [diff] [blame] | 36 | test100.out test101.out test102.out test103.out test104.out \ |
Bram Moolenaar | c35b0fb | 2014-05-29 11:47:40 +0200 | [diff] [blame] | 37 | test105.out test106.out test107.out\ |
Bram Moolenaar | 4bde00c | 2015-01-20 19:31:02 +0100 | [diff] [blame] | 38 | test_argument_0count.out \ |
Bram Moolenaar | b96a7f3 | 2014-11-27 16:22:48 +0100 | [diff] [blame] | 39 | test_argument_count.out \ |
Bram Moolenaar | d69bd9a | 2014-04-29 12:15:40 +0200 | [diff] [blame] | 40 | test_autoformat_join.out \ |
Bram Moolenaar | 597a422 | 2014-06-25 14:39:50 +0200 | [diff] [blame] | 41 | test_breakindent.out \ |
Bram Moolenaar | 23fb7a9 | 2014-07-30 14:05:00 +0200 | [diff] [blame] | 42 | test_changelist.out \ |
Bram Moolenaar | b96a7f3 | 2014-11-27 16:22:48 +0100 | [diff] [blame] | 43 | test_close_count.out \ |
Bram Moolenaar | f1d6ccf | 2014-12-08 04:16:44 +0100 | [diff] [blame] | 44 | test_command_count.out \ |
Bram Moolenaar | b7cb42b | 2014-04-02 19:55:10 +0200 | [diff] [blame] | 45 | test_eval.out \ |
Bram Moolenaar | 4f5ce33 | 2014-07-30 16:00:58 +0200 | [diff] [blame] | 46 | test_insertcount.out \ |
Bram Moolenaar | b5cf6c3 | 2014-08-16 18:36:43 +0200 | [diff] [blame] | 47 | test_listlbr.out \ |
| 48 | test_listlbr_utf8.out \ |
Bram Moolenaar | bdef518 | 2014-10-21 16:22:17 +0200 | [diff] [blame] | 49 | test_mapping.out \ |
Bram Moolenaar | f65aad5 | 2015-02-17 13:43:40 +0100 | [diff] [blame] | 50 | test_marks.out \ |
Bram Moolenaar | ef92390 | 2014-12-13 21:00:55 +0100 | [diff] [blame] | 51 | test_nested_function.out \ |
Bram Moolenaar | b5cf6c3 | 2014-08-16 18:36:43 +0200 | [diff] [blame] | 52 | test_options.out \ |
| 53 | test_qf_title.out \ |
Bram Moolenaar | 482a2b5 | 2014-10-21 20:57:15 +0200 | [diff] [blame] | 54 | test_signs.out \ |
Bram Moolenaar | b5cf6c3 | 2014-08-16 18:36:43 +0200 | [diff] [blame] | 55 | test_utf8.out |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 56 | |
Bram Moolenaar | 7e506b6 | 2010-01-19 15:55:06 +0100 | [diff] [blame] | 57 | SCRIPTS32 = test50.out test70.out |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 58 | |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 59 | SCRIPTS_GUI = test16.out |
| 60 | |
| 61 | TEST_OUTFILES = $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) $(SCRIPTS_GUI) |
| 62 | DOSTMP = dostmp |
| 63 | DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test) |
| 64 | DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 65 | |
| 66 | .SUFFIXES: .in .out |
| 67 | |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 68 | nongui: nolog $(SCRIPTS16) $(SCRIPTS) report |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 69 | |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 70 | small: nolog report |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 71 | |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 72 | gui: nolog $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) report |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 73 | |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 74 | win32: nolog $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) report |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 75 | |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 76 | # Copy the input files to dostmp, changing the fileformat to dos. |
| 77 | $(DOSTMP_INFILES): $(*B).in |
| 78 | if not exist $(DOSTMP)\NUL md $(DOSTMP) |
| 79 | if exist $@ del $@ |
| 80 | $(VIMPROG) -u dos.vim --noplugin "+set ff=dos|f $@|wq" $(*B).in |
| 81 | |
| 82 | # For each input file dostmp/test99.in run the tests. |
| 83 | # This moves test99.in to test99.in.bak temporarily. |
| 84 | $(TEST_OUTFILES): $(DOSTMP)\$(*B).in |
| 85 | -@if exist test.out DEL test.out |
| 86 | move $(*B).in $(*B).in.bak |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 87 | copy $(DOSTMP)\$(*B).in $(*B).in |
| 88 | copy $(*B).ok test.ok |
| 89 | $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $(*B).in |
| 90 | -@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out |
| 91 | -@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in |
| 92 | -@del X* |
| 93 | -@if exist test.ok del test.ok |
| 94 | -@if exist Xdir1 rd /s /q Xdir1 |
| 95 | -@if exist Xfind rd /s /q Xfind |
| 96 | -@if exist viminfo del viminfo |
| 97 | $(VIMPROG) -u dos.vim --noplugin "+set ff=unix|f test.out|wq" \ |
| 98 | $(DOSTMP)\$(*B).out |
| 99 | @diff test.out $*.ok & if errorlevel 1 \ |
| 100 | ( move /y test.out $*.failed \ |
| 101 | & del $(DOSTMP)\$(*B).out \ |
| 102 | & echo $* FAILED >> test.log ) \ |
| 103 | else ( move /y test.out $*.out ) |
Bram Moolenaar | b78b0b0 | 2005-01-02 11:32:29 +0000 | [diff] [blame] | 104 | |
Bram Moolenaar | 6949eea | 2013-06-16 16:57:46 +0200 | [diff] [blame] | 105 | report: |
| 106 | @echo "" |
| 107 | @echo Test results: |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 108 | @if exist test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \ |
| 109 | else ( echo ALL DONE ) |
Bram Moolenaar | 6949eea | 2013-06-16 16:57:46 +0200 | [diff] [blame] | 110 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 111 | clean: |
| 112 | -del *.out |
Bram Moolenaar | 555d2a8 | 2013-06-17 21:53:37 +0200 | [diff] [blame] | 113 | -del *.failed |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 114 | -if exist $(DOSTMP) rd /s /q $(DOSTMP) |
| 115 | -if exist test.in del test.in |
Bram Moolenaar | 9c03978 | 2007-08-14 15:55:42 +0000 | [diff] [blame] | 116 | -if exist test.ok del test.ok |
| 117 | -if exist small.vim del small.vim |
| 118 | -if exist tiny.vim del tiny.vim |
| 119 | -if exist mbyte.vim del mbyte.vim |
Bram Moolenaar | 2498b3a | 2010-03-02 17:59:44 +0100 | [diff] [blame] | 120 | -if exist mzscheme.vim del mzscheme.vim |
Bram Moolenaar | b35c338 | 2012-10-06 19:10:35 +0200 | [diff] [blame] | 121 | -if exist lua.vim del lua.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 122 | -del X* |
Bram Moolenaar | 555d2a8 | 2013-06-17 21:53:37 +0200 | [diff] [blame] | 123 | -if exist Xdir1 rd /s /q Xdir1 |
| 124 | -if exist Xfind rd /s /q Xfind |
Bram Moolenaar | 9c03978 | 2007-08-14 15:55:42 +0000 | [diff] [blame] | 125 | -if exist viminfo del viminfo |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 126 | -if exist test.log del test.log |
Bram Moolenaar | 9c7d98d | 2014-11-05 15:46:09 +0100 | [diff] [blame] | 127 | -if exist benchmark.out del benchmark.out |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 128 | |
Bram Moolenaar | 6949eea | 2013-06-16 16:57:46 +0200 | [diff] [blame] | 129 | nolog: |
Bram Moolenaar | 13cf77b | 2015-02-27 21:11:02 +0100 | [diff] [blame] | 130 | -if exist test.log del test.log |
Bram Moolenaar | fda3729 | 2014-11-05 14:27:36 +0100 | [diff] [blame] | 131 | |
| 132 | benchmark: |
| 133 | bench_re_freeze.out |
| 134 | |
| 135 | bench_re_freeze.out: bench_re_freeze.vim |
| 136 | -if exist benchmark.out del benchmark.out |
| 137 | $(VIMPROG) -u dos.vim -U NONE --noplugin $*.in |
| 138 | @IF EXIST benchmark.out ( type benchmark.out ) |