3 # ?shell directive to pmcpp
5 # Copyright (c) 2015 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 status
=1 # failure is the default!
17 $sudo rm -rf $tmp.
* $seq.full
18 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
27 cat <<End-of-File >$tmp.in
28 Some text at the front.
30 #define blah something
32 #shell 'if [ -f $tmp.flag ]; then echo "#define foo bar"; else echo ""; fi'
35 foo is defined as #{foo}
40 Just checking blah is defined as #blah, so should be here
44 # real QA test starts here
45 echo "=== no flag file ==="
46 pmcpp
-Pr <$tmp.
in | _filter
49 echo "=== flag file exists ==="
51 pmcpp
-Pr <$tmp.
in | _filter
54 echo "=== shell style, flag file exists ==="
55 sed -e 's/#/%/g' <$tmp.
in \
56 | pmcpp
-Prs | _filter
59 echo "=== ?shell error and signal cases ==="
60 cat <<End-of-File | pmcpp -P 2>$tmp.err | _filter
66 cat <<'End-of-File' | pmcpp -P 2>$tmp.err | _filter
74 echo "=== ?shell and ?include nesting ==="
75 cat <<End-of-File >$tmp.in
80 cat <<End-of-File >$tmp.shell
81 --- include text before
83 --- include text after
85 pmcpp
-Prs $tmp.
in 2>$tmp.err | _filter