3 # Test ascii PMNS without cpp
5 # Copyright (c) 2011 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 status
=0 # success is the default!
17 $sudo rm -rf $tmp.
* $seq.full
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
24 -e "s;$PCP_VAR_DIR;PCP_VAR_DIR;g"
27 # real QA test starts here
28 echo "no error cases ..."
29 echo "---------------- 1 -----------------"
30 cat <<End-of-File >$tmp.root
46 pmcpp
$tmp.root
2>&1 | _filter
49 echo "---------------- 2 -----------------"
50 cat <<End-of-File >$tmp.root
55 cat <<End-of-File >$tmp.1
64 cat <<End-of-File >$tmp.2
72 pmcpp
$tmp.root
2>&1 | _filter
76 echo "---------------- 3 -----------------"
77 cat <<End-of-File >$tmp.root
88 cat <<End-of-File >$tmp.1
94 pmcpp
$tmp.root
2>&1 | _filter
98 echo "---------------- 4 -----------------"
99 cat <<End-of-File >$tmp.root
111 cat <<End-of-File >$tmp.1
117 pmcpp
$tmp.root
2>&1 | _filter
121 echo "---------------- 5 -----------------"
122 cat <<End-of-File >$tmp.root
124 #define foo_path3 foo.three
143 pmcpp
$tmp.root
2>&1 | _filter
147 echo "---------------- 6 -----------------"
148 cat <<End-of-File >$tmp.root
149 /* comment at the beginning */
156 three /*inline comment*/ 4:5:6
160 but syntactically ok */
166 * multi-line comment at the end
169 pmcpp
$tmp.root
2>&1 | _filter
172 # note ... strip blank lines here because number of lines in
173 # <stdpmid> may vary over time
176 echo "---------------- 7 -----------------"
177 cat <<End-of-File >$tmp.root
181 sampledso SAMPLEDSO:*:*
184 pmcpp
$tmp.root
2>&1 | _filter |
sed -e '/^[ ]*$/d'
187 echo "---------------- 8 -----------------"
188 cat <<End-of-File >$tmp.root
192 sampledso SAMPLEDSO:*:*
196 pmcpp
-DSAMPLE=29 -DSAMPLEDSO=30 -Dfoo $tmp.root
2>&1 | _filter
198 echo "---------------- 8a -----------------"
203 cat <<End-of-File >$tmp.in
204 /* white space after include filename */
205 #include "$tmp.1" /* spaces */
206 /* spaces, no comment ... this was Nathan's Mac OS X failure */
208 #include <$tmp.3> /* tab */
209 /* tab, no comment */
212 pmcpp
-P $tmp.
in 2>&1 | _filter
214 echo "---------------- 8b -----------------"
215 cat <<End-of-File >$tmp.in
216 # white space after include filename
217 # spaces, no comment ... this was Nathan's Mac OS X failure */
222 pmcpp
-sP $tmp.
in 2>&1 | _filter
225 echo "#include errors ..."
226 echo "---------------- 9 -----------------"
227 cat <<End-of-File >$tmp.root
232 pmcpp
$tmp.root
2>&1 | _filter
235 echo "---------------- 10 -----------------"
236 cat <<End-of-File >$tmp.root
241 pmcpp
$tmp.root
2>&1 | _filter
243 echo "---------------- 11 -----------------"
244 cat <<End-of-File >$tmp.root
249 pmcpp
$tmp.root
2>&1 | _filter
251 echo "---------------- 12 -----------------"
252 cat <<End-of-File >$tmp.root
254 #include "$tmp.1" junk
257 pmcpp
$tmp.root
2>&1 | _filter
260 echo "---------------- 13 -----------------"
261 cat <<End-of-File >$tmp.root
266 pmcpp
$tmp.root
2>&1 | _filter
269 echo "---------------- 14 -----------------"
270 cat <<End-of-File >$tmp.root
276 cat <<End-of-File >$tmp.1
280 cat <<End-of-File >$tmp.2
284 cat <<End-of-File >$tmp.3
288 cat <<End-of-File >$tmp.4
292 pmcpp
$tmp.root
2>&1 | _filter
296 echo "#define errors ..."
297 echo "---------------- 15 -----------------"
298 cat <<End-of-File >$tmp.root
303 pmcpp
$tmp.root
2>&1 | _filter
305 echo "---------------- 16 -----------------"
306 cat <<End-of-File >$tmp.root
308 /* white space at the end of the next line */
312 pmcpp
$tmp.root
2>&1 | _filter
314 echo "---------------- 17 -----------------"
315 cat <<End-of-File >$tmp.root
320 pmcpp
$tmp.root
2>&1 | _filter
322 echo "---------------- 18 -----------------"
323 cat <<End-of-File >$tmp.root
325 #define bad_123_macro!name
328 pmcpp
$tmp.root
2>&1 | _filter
330 echo "---------------- 19 -----------------"
331 cat <<End-of-File >$tmp.root
337 pmcpp
$tmp.root
2>&1 | _filter
339 echo "---------------- 20 -----------------"
340 cat <<End-of-File >$tmp.root
344 pmcpp
-Dfoo=1 -Dfoo $tmp.root
2>&1 | _filter
346 echo "---------------- 21 -----------------"
347 cat <<End-of-File >$tmp.root
351 pmcpp
-Dfoo-bar=1 $tmp.root
2>&1 | _filter
354 echo "#ifdef etc errors ..."
355 echo "---------------- 22 -----------------"
356 cat <<End-of-File >$tmp.root
358 #ifndef extra /*does not count*/ !
361 pmcpp
$tmp.root
2>&1 | _filter
363 echo "---------------- 23 -----------------"
364 cat <<End-of-File >$tmp.root
368 #endif /* not matched */
371 pmcpp
$tmp.root
2>&1 | _filter
373 echo "---------------- 24 -----------------"
374 cat <<End-of-File >$tmp.root
379 #ifdef nested /* <- error */
384 pmcpp
$tmp.root
2>&1 | _filter
386 echo "---------------- 25 -----------------"
387 cat <<End-of-File >$tmp.root
392 #ifndef nested /* <- error */
397 pmcpp
$tmp.root
2>&1 | _filter
400 echo "other #cpp line errors ..."
401 echo "---------------- 26 -----------------"
402 cat <<End-of-File >$tmp.root
407 pmcpp
$tmp.root
2>&1 | _filter