summaryrefslogtreecommitdiff
path: root/unit-tests/directives.mk
blob: 50e8e1315dda92711517a3813b77a53e49702bf3 (plain) (blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# $NetBSD: directives.mk,v 1.5 2020/07/28 20:57:59 rillig Exp $
#
# Tests for parsing directives, in the same order as in the manual page.
#
# Each test group has 10 lines, to keep the line numbers in directives.exp
# stable.
#
# no tests for .error since it exits immediately, see ParseMessage.

.info begin .export tests
.expor				# misspelled
.export				# oops: missing argument
.export VARNAME
.exporting works		# oops: misspelled





.info begin .export-env tests
.export-en			# oops: misspelled
.export-env
.export-environment		# oops: misspelled






.info begin .export-literal tests
.export-litera			# oops: misspelled
.export-literal			# oops: missing argument
.export-literal VARNAME
.export-literally		# oops: misspelled





.info begin .info tests
.inf				# misspelled
.info				# oops: message should be "missing parameter"
.info message
.info		indented message
.information
.information message		# oops: misspelled
.info.man:			# not a message, but a suffix rule


.info begin .undef tests
.unde				# misspelled
.undef				# oops: missing argument
.undefined			# oops: misspelled
.undef VARNAME





.info begin .unexport tests
.unexpor			# misspelled
.unexport			# oops: missing argument
.unexport VARNAME		# ok
.unexporting works		# oops: misspelled





.info begin .unexport-env tests
.unexport-en			# misspelled
.unexport-env			# ok
.unexport-environment		# oops: misspelled






.info begin .warning tests
.warn				# misspelled
.warnin				# misspelled
.warning			# oops: should be "missing argument"
.warning message		# ok
.warnings			# misspelled
.warnings messages		# oops



.info begin .elif misspellings tests, part 1
.if 1
.elif 1				# ok
.elsif 1			# oops: misspelled
.elseif 1			# oops: misspelled
.endif




.info begin .elif misspellings tests, part 2
.if 0
.elif 0				# ok
.elsif 0			# oops: misspelled
.elseif 0			# oops: misspelled
.endif




.info begin .elif misspellings tests, part 3
.if 0
.elsif 0			# oops: misspelled
.endif
.if 0
.elseif 0			# oops: misspelled
.endif



.info which branch is taken on misspelling after false?
.if 0
.elsif 1
.info 1 taken
.elsif 2
.info 2 taken
.else
.info else taken
.endif

.info which branch is taken on misspelling after true?
.if 1
.elsif 1
.info 1 taken
.elsif 2
.info 2 taken
.else
.info else taken
.endif

.indented none
.  indented 2 spaces
.	indented tab
.${:Uinfo} directives cannot be indirect






.include "nonexistent.mk"
.include "/dev/null"		# size 0
# including a directory technically succeeds, but shouldn't.
#.include "."			# directory






.info end of the tests

all:
	@: