Mercurial > vim
annotate src/testdir/Make_mvc.mak @ 33811:06219b3bdaf3 v9.0.2121
patch 9.0.2121: [security]: use-after-free in ex_substitute
Commit: https://github.com/vim/vim/commit/26c11c56888d01e298cd8044caf860f3c26f57bb
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Nov 22 21:26:41 2023 +0100
patch 9.0.2121: [security]: use-after-free in ex_substitute
Problem: [security]: use-after-free in ex_substitute
Solution: always allocate memory
closes: #13552
A recursive :substitute command could cause a heap-use-after free in Vim
(CVE-2023-48706).
The whole reproducible test is a bit tricky, I can only reproduce this
reliably when no previous substitution command has been used yet
(which is the reason, the test needs to run as first one in the
test_substitute.vim file) and as a combination of the `:~` command
together with a :s command that contains the special substitution atom `~\=`
which will make use of a sub-replace special atom and calls a vim script
function.
There was a comment in the existing :s code, that already makes the
`sub` variable allocate memory so that a recursive :s call won't be able
to cause any issues here, so this was known as a potential problem
already. But for the current test-case that one does not work, because
the substitution does not start with `\=` but with `~\=` (and since
there does not yet exist a previous substitution atom, Vim will simply
increment the `sub` pointer (which then was not allocated dynamically)
and later one happily use a sub-replace special expression (which could
then free the `sub` var).
The following commit fixes this, by making the sub var always using
allocated memory, which also means we need to free the pointer whenever
we leave the function. Since sub is now always an allocated variable,
we also do no longer need the sub_copy variable anymore, since this one
was used to indicated when sub pointed to allocated memory (and had
therefore to be freed on exit) and when not.
Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-c8qm-x72m-q53q
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 22 Nov 2023 22:15:05 +0100 |
parents | 429279c35b1e |
children | 4f63df5700aa |
rev | line source |
---|---|
30170
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 # |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 # Makefile to run all tests for Vim, on Dos-like machines. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 # |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 # Requires a set of Unix tools: echo, diff, etc. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 |
31209
429279c35b1e
patch 9.0.0938: MS-Windows: debug executable not found when running test
Bram Moolenaar <Bram@vim.org>
parents:
30449
diff
changeset
|
6 # Testing may be done with a debug build |
429279c35b1e
patch 9.0.0938: MS-Windows: debug executable not found when running test
Bram Moolenaar <Bram@vim.org>
parents:
30449
diff
changeset
|
7 !IF EXIST(..\\vimd.exe) && !EXIST(..\\vim.exe) |
429279c35b1e
patch 9.0.0938: MS-Windows: debug executable not found when running test
Bram Moolenaar <Bram@vim.org>
parents:
30449
diff
changeset
|
8 VIMPROG = ..\\vimd |
429279c35b1e
patch 9.0.0938: MS-Windows: debug executable not found when running test
Bram Moolenaar <Bram@vim.org>
parents:
30449
diff
changeset
|
9 !ELSE |
30170
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 VIMPROG = ..\\vim |
31209
429279c35b1e
patch 9.0.0938: MS-Windows: debug executable not found when running test
Bram Moolenaar <Bram@vim.org>
parents:
30449
diff
changeset
|
11 !ENDIF |
429279c35b1e
patch 9.0.0938: MS-Windows: debug executable not found when running test
Bram Moolenaar <Bram@vim.org>
parents:
30449
diff
changeset
|
12 |
30170
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 default: nongui |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 !include Make_all.mak |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 # Explicit dependencies. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 test_options.res test_alot.res: opt_test.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 TEST_OUTFILES = $(SCRIPTS_TINY_OUT) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 DOSTMP = dostmp |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 DOSTMP_OUTFILES = $(TEST_OUTFILES:test=dostmp\test) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 DOSTMP_INFILES = $(DOSTMP_OUTFILES:.out=.in) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 .SUFFIXES: .in .out .res .vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 # Add --gui-dialog-file to avoid getting stuck in a dialog. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 COMMON_ARGS = $(NO_INITS) --gui-dialog-file guidialog |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 nongui: nolog tinytests newtests report |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 gui: nolog tinytests newtests report |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 tiny: nolog tinytests report |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 benchmark: $(SCRIPTS_BENCH) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 report: |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 @rem without the +eval feature test_result.log is a copy of test.log |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 @if exist test.log ( copy /y test.log test_result.log > nul ) \ |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 else ( echo No failures reported > test_result.log ) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 $(VIMPROG) -u NONE $(COMMON_ARGS) -S summarize.vim messages |
30449
55aa44dd59ef
patch 9.0.0560: elapsed time since testing started is not visible
Bram Moolenaar <Bram@vim.org>
parents:
30170
diff
changeset
|
44 -if exist starttime del starttime |
30170
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 @echo. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 @echo Test results: |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
47 @cmd /c type test_result.log |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 @if exist test.log ( echo TEST FAILURE & exit /b 1 ) \ |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 else ( echo ALL DONE ) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 # Execute an individual new style test, e.g.: |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
53 # nmake -f Make_mvc.mak test_largefile |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 $(NEW_TESTS): |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 -if exist $@.res del $@.res |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 -if exist test.log del test.log |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 -if exist messages del messages |
30449
55aa44dd59ef
patch 9.0.0560: elapsed time since testing started is not visible
Bram Moolenaar <Bram@vim.org>
parents:
30170
diff
changeset
|
58 -if exist starttime del starttime |
30170
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
59 @$(MAKE) -nologo -f Make_mvc.mak $@.res VIMPROG=$(VIMPROG) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
60 @type messages |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
61 @if exist test.log exit 1 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
63 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 # Delete files that may interfere with running tests. This includes some files |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 # that may result from working on the tests, not only from running them. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 clean: |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 -if exist *.out del *.out |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 -if exist *.failed del *.failed |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 -if exist *.res del *.res |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 -if exist $(DOSTMP) rd /s /q $(DOSTMP) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 -if exist test.in del test.in |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 -if exist test.ok del test.ok |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 -if exist Xdir1 rd /s /q Xdir1 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 -if exist Xfind rd /s /q Xfind |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 -if exist XfakeHOME rd /s /q XfakeHOME |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 -if exist X* del X* |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 -for /d %i in (X*) do @rd /s/q %i |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 -if exist viminfo del viminfo |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 -if exist test.log del test.log |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 -if exist test_result.log del test_result.log |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 -if exist messages del messages |
30449
55aa44dd59ef
patch 9.0.0560: elapsed time since testing started is not visible
Bram Moolenaar <Bram@vim.org>
parents:
30170
diff
changeset
|
82 -if exist starttime del starttime |
30170
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
83 -if exist benchmark.out del benchmark.out |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
84 -if exist opt_test.vim del opt_test.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
85 -if exist guidialog del guidialog |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
86 -if exist guidialogfile del guidialogfile |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
87 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
88 nolog: |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
89 -if exist test.log del test.log |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
90 -if exist test_result.log del test_result.log |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 -if exist messages del messages |
30449
55aa44dd59ef
patch 9.0.0560: elapsed time since testing started is not visible
Bram Moolenaar <Bram@vim.org>
parents:
30170
diff
changeset
|
92 -if exist starttime del starttime |
30170
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
93 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
94 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
95 # Tiny tests. Works even without the +eval feature. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
96 tinytests: $(SCRIPTS_TINY_OUT) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
97 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
98 # Copy the input files to dostmp, changing the fileformat to dos. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
99 $(DOSTMP_INFILES): $(*B).in |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
100 if not exist $(DOSTMP)\NUL md $(DOSTMP) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
101 if exist $@ del $@ |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
102 $(VIMPROG) -u dos.vim $(COMMON_ARGS) "+set ff=dos|f $@|wq" $(*B).in |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
103 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
104 # For each input file dostmp/test99.in run the tests. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
105 # This moves test99.in to test99.in.bak temporarily. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
106 $(TEST_OUTFILES): $(DOSTMP)\$(*B).in |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
107 -@if exist test.out DEL test.out |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 -@if exist $(DOSTMP)\$(*B).out DEL $(DOSTMP)\$(*B).out |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
109 move $(*B).in $(*B).in.bak > nul |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
110 copy $(DOSTMP)\$(*B).in $(*B).in > nul |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
111 copy $(*B).ok test.ok > nul |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
112 $(VIMPROG) -u dos.vim $(COMMON_ARGS) -s dotest.in $(*B).in |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
113 -@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out > nul |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
114 -@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in > nul |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
115 -@if exist test.ok del test.ok |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
116 -@if exist Xdir1 rd /s /q Xdir1 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
117 -@if exist Xfind rd /s /q Xfind |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
118 -@if exist XfakeHOME rd /s /q XfakeHOME |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
119 -@del X* |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
120 -@if exist viminfo del viminfo |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
121 $(VIMPROG) -u dos.vim $(COMMON_ARGS) "+set ff=unix|f test.out|wq" \ |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
122 $(DOSTMP)\$(*B).out |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
123 @diff test.out $*.ok & if errorlevel 1 \ |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
124 ( move /y test.out $*.failed > nul \ |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
125 & del $(DOSTMP)\$(*B).out \ |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
126 & echo $* FAILED >> test.log ) \ |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
127 else ( move /y test.out $*.out > nul ) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
128 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
129 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
130 # New style of tests uses Vim script with assert calls. These are easier |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
131 # to write and a lot easier to read and debug. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
132 # Limitation: Only works with the +eval feature. |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
133 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
134 newtests: newtestssilent |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
135 @if exist messages type messages |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
136 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
137 newtestssilent: $(NEW_TESTS_RES) |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
138 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
139 .vim.res: |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
140 @echo $(VIMPROG) > vimcmd |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
141 $(VIMPROG) -u NONE $(COMMON_ARGS) -S runtest.vim $*.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
142 @del vimcmd |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
143 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
144 test_gui.res: test_gui.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
145 @echo $(VIMPROG) > vimcmd |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
146 $(VIMPROG) -u NONE $(COMMON_ARGS) -S runtest.vim $*.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
147 @del vimcmd |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
148 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
149 test_gui_init.res: test_gui_init.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
150 @echo $(VIMPROG) > vimcmd |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
151 $(VIMPROG) -u gui_preinit.vim -U gui_init.vim $(NO_PLUGINS) -S runtest.vim $*.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
152 @del vimcmd |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
153 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
154 opt_test.vim: ../optiondefs.h gen_opt_test.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
155 $(VIMPROG) -u NONE -S gen_opt_test.vim --noplugin --not-a-term ../optiondefs.h |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
156 |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
157 test_bench_regexp.res: test_bench_regexp.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
158 -if exist benchmark.out del benchmark.out |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
159 @echo $(VIMPROG) > vimcmd |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
160 $(VIMPROG) -u NONE $(COMMON_ARGS) -S runtest.vim $*.vim |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
161 @del vimcmd |
ba9d53c7c509
patch 9.0.0421: MS-Windows makefiles are inconsistently named
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
162 @IF EXIST benchmark.out ( type benchmark.out ) |