]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/directives.mk
Update to bmake-20201101
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / directives.mk
1 # $NetBSD: directives.mk,v 1.6 2020/10/24 08:46:08 rillig Exp $
2 #
3 # Tests for parsing directives, in the same order as in the manual page.
4 #
5 # Each test group has 10 lines, to keep the line numbers in directives.exp
6 # stable.
7 #
8 # no tests for .error since it exits immediately, see ParseMessage.
9
10 .info begin .export tests
11 .expor                          # misspelled
12 .export                         # oops: missing argument
13 .export VARNAME
14 .exporting works                # oops: misspelled
15
16
17
18
19
20 .info begin .export-env tests
21 .export-en                      # oops: misspelled
22 .export-env
23 .export-environment             # oops: misspelled
24
25
26
27
28
29
30 .info begin .export-literal tests
31 .export-litera                  # oops: misspelled
32 .export-literal                 # oops: missing argument
33 .export-literal VARNAME
34 .export-literally               # oops: misspelled
35
36
37
38
39
40 .info begin .info tests
41 .inf                            # misspelled
42 .info                           # oops: message should be "missing parameter"
43 .info message
44 .info           indented message
45 .information
46 .information message            # oops: misspelled
47 .info.man:                      # not a message, but a suffix rule
48
49
50 .info begin .undef tests
51 .unde                           # misspelled
52 .undef                          # oops: missing argument
53 .undefined                      # oops: misspelled
54 .undef VARNAME
55
56
57
58
59
60 .info begin .unexport tests
61 .unexpor                        # misspelled
62 .unexport                       # oops: missing argument
63 .unexport VARNAME               # ok
64 .unexporting works              # oops: misspelled
65
66
67
68
69
70 .info begin .unexport-env tests
71 .unexport-en                    # misspelled
72 .unexport-env                   # ok
73 .unexport-environment           # oops: misspelled
74
75
76
77
78
79
80 .info begin .warning tests
81 .warn                           # misspelled
82 .warnin                         # misspelled
83 .warning                        # oops: should be "missing argument"
84 .warning message                # ok
85 .warnings                       # misspelled
86 .warnings messages              # oops
87
88
89
90 .info begin .elif misspellings tests, part 1
91 .if 1
92 .elif 1                         # ok
93 .elsif 1                        # oops: misspelled
94 .elseif 1                       # oops: misspelled
95 .endif
96
97
98
99
100 .info begin .elif misspellings tests, part 2
101 .if 0
102 .elif 0                         # ok
103 .elsif 0                        # oops: misspelled
104 .elseif 0                       # oops: misspelled
105 .endif
106
107
108
109
110 .info begin .elif misspellings tests, part 3
111 .if 0
112 .elsif 0                        # oops: misspelled
113 .endif
114 .if 0
115 .elseif 0                       # oops: misspelled
116 .endif
117
118
119
120 .info which branch is taken on misspelling after false?
121 .if 0
122 .elsif 1
123 .  info 1 taken
124 .elsif 2
125 .  info 2 taken
126 .else
127 .  info else taken
128 .endif
129
130 .info which branch is taken on misspelling after true?
131 .if 1
132 .elsif 1
133 .  info 1 taken
134 .elsif 2
135 .  info 2 taken
136 .else
137 .  info else taken
138 .endif
139
140 .indented none
141 .  indented 2 spaces
142 .       indented tab
143 .${:Uinfo} directives cannot be indirect
144
145
146
147
148
149
150 .include "nonexistent.mk"
151 .include "/dev/null"            # size 0
152 # including a directory technically succeeds, but shouldn't.
153 #.include "."                   # directory
154
155
156
157
158
159
160 .info end of the tests
161
162 all:
163         @: