summaryrefslogtreecommitdiffstats
path: root/tests/makefiles/blackbox/inlineFiles/test.mk
blob: a7fadafeca2db8d84a1af0055f8e2a086b6723e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# test inline files in make files
#
# http://msdn.microsoft.com/en-us/library/1whxt45w.aspx

all:
	@echo Please specify a target.

tests: test_basic test_fileRemoval test_keepFile test_multipleFiles test_escaping

init:
	@if exist output rmdir /s /q output
	@md output
	@echo ::post test check script > output\post_check.cmd

post_check:
	@output\post_check.cmd

test_basic:
	copy << output\test_basic.txt
line 1
!ifndef UNDEFINED_MACRO
line 2
!endif
line 3
<<

test_fileRemoval:
	echo @if exist << exit /b 1 >> output\post_check.cmd
some random text
<<
	echo @if exist <<namedInlineFile1.txt exit /b 1 >> output\post_check.cmd
some random text
<<
	echo @if exist <<namedInlineFile2.txt exit /b 1 >> output\post_check.cmd
some random text
<<NOKEEP

test_keepFile:
	echo @if not exist <<"output\named inline file3.txt" exit /b 1 >> output\post_check.cmd
some random text
<<KEEP

test_multipleFiles:
	type << << >output\test_multipleFiles.txt
one
two
<<
three
four
<<

test_escaping:
    copy << output\test_escaping.txt
InRoot$$$$Sections
# This line should be there.
<<