pmrep: update TODO, man page
[pcp.git] / qa / 1093
blobba74f9f8e204a57ab221c36f2ee85a59758a7c32
1 #!/bin/sh
2 # PCP QA Test No. 1093
3 # ?shell directive to pmcpp
5 # Copyright (c) 2015 Ken McDonell. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
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
20 _filter()
22 sed \
23 -e "s@$tmp@TMP@g" \
24 # end
27 cat <<End-of-File >$tmp.in
28 Some text at the front.
30 #define blah something
31 ---before text
32 #shell 'if [ -f $tmp.flag ]; then echo "#define foo bar"; else echo ""; fi'
33 ---after text
34 #ifdef foo
35 foo is defined as #{foo}
36 #else
37 foo is not defined
38 #endif
39 #ifdef blah
40 Just checking blah is defined as #blah, so should be here
41 #endif
42 End-of-File
44 # real QA test starts here
45 echo "=== no flag file ==="
46 pmcpp -Pr <$tmp.in | _filter
48 echo
49 echo "=== flag file exists ==="
50 touch $tmp.flag
51 pmcpp -Pr <$tmp.in | _filter
53 echo
54 echo "=== shell style, flag file exists ==="
55 sed -e 's/#/%/g' <$tmp.in \
56 | pmcpp -Prs | _filter
58 echo
59 echo "=== ?shell error and signal cases ==="
60 cat <<End-of-File | pmcpp -P 2>$tmp.err | _filter
61 --- text before
62 #shell 'exit 13'
63 --- text after
64 End-of-File
65 _filter <$tmp.err
66 cat <<'End-of-File' | pmcpp -P 2>$tmp.err | _filter
67 --- text before
68 #shell "kill -13 $$"
69 --- text after
70 End-of-File
71 _filter <$tmp.err
73 echo
74 echo "=== ?shell and ?include nesting ==="
75 cat <<End-of-File >$tmp.in
76 --- outer text before
77 %include "$tmp.shell"
78 --- outer text after
79 End-of-File
80 cat <<End-of-File >$tmp.shell
81 --- include text before
82 %shell "cat $tmp.in"
83 --- include text after
84 End-of-File
85 pmcpp -Prs $tmp.in 2>$tmp.err | _filter
86 _filter <$tmp.err
88 # success, all done
89 status=0
91 exit