Merge branch 'master' of https://github.com/kmcdonell/pcp into kenj-merge
[pcp.git] / qa / 534
blobb52209f3d969fae141c499f08465e59037b688ad
1 #! /bin/sh
2 # PCP QA Test No. 534
3 # #566355 - Macros cannot be used to define a metric name
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. 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 trap "rm -f /tmp/echo-out $tmp.*; exit \$status" 0 1 2 3 15
18 rm -f /tmp/echo-out
20 # real QA test starts here
21 cat <<'End-of-File' | pmie -v -t 2sec -T 1sec 2>$tmp.err
22 // one level macro substitution
24 n1 = "sample.long";
25 n2 = "long";
26 n3 = "ple.long";
27 n4 = "ple.long.";
29 $n1.one + $n1.ten + $n1.million; // start of ident
30 sample.$n2.one + sample.$n2.ten + sample.$n2.million; // middle of ident
31 sam$n3.one + sam$n3.ten + sam$n3.million; // partial
32 sam$'n4'one + sam$'n4'ten + sam$'n4'million; // macro-in-ident
34 // nested macro substitution (from right)
36 m0 = "sample.long.ten+sample.long.million;";
37 m1 = "+$m0";
38 m2 = "one$m1";
39 m3 = "long.$m2";
40 m4 = "sample.$m3";
41 $m4
43 // nested macro substitution (from left)
44 p0 = "sample.";
45 p1 = "$'p0'long.";
46 p2 = "$'p1'one+";
47 p3 = "$p2$'p1'ten+";
48 p4 = "$p3$'p1'million";
49 $p4;
51 // this is sick
53 d0 = "some";
54 hash = "#'bin-";
55 $'d0'_inst $'p0'bin $'hash'100' $'hash'200' $'hash'300' > 100
56 -> shell "echo >>/tmp/echo-out high:" " %i:%v";
58 End-of-File
60 # Allow some time fo echo-out to be created
61 sleep 2
63 cat /tmp/echo-out
65 echo
66 echo "errors? ..."
67 _filter_pmie_log <$tmp.err
69 # success, all done
70 status=0
71 exit