File: 534

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (71 lines) | stat: -rwxr-xr-x 1,509 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#! /bin/sh
# PCP QA Test No. 534
# #566355 - Macros cannot be used to define a metric name
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

status=1	# failure is the default!
trap "rm -f /tmp/echo-out $tmp.*; exit \$status" 0 1 2 3 15
rm -f /tmp/echo-out

# real QA test starts here
cat <<'End-of-File' | pmie -v -t 2sec -T 1sec 2>$tmp.err
// one level macro substitution
//
n1 = "sample.long";
n2 = "long";
n3 = "ple.long";
n4 = "ple.long.";

$n1.one + $n1.ten + $n1.million;			// start of ident
sample.$n2.one + sample.$n2.ten + sample.$n2.million;	// middle of ident
sam$n3.one + sam$n3.ten + sam$n3.million;		// partial
sam$'n4'one + sam$'n4'ten + sam$'n4'million;		// macro-in-ident

// nested macro substitution (from right)
//
m0 = "sample.long.ten+sample.long.million;";
m1 = "+$m0";
m2 = "one$m1";
m3 = "long.$m2";
m4 = "sample.$m3";
$m4

// nested macro substitution (from left)
p0 = "sample.";
p1 = "$'p0'long.";
p2 = "$'p1'one+";
p3 = "$p2$'p1'ten+";
p4 = "$p3$'p1'million";
$p4;

// this is sick
//
d0 = "some";
hash = "#'bin-";
$'d0'_inst $'p0'bin $'hash'100' $'hash'200' $'hash'300' > 100
    -> shell "echo >>/tmp/echo-out high:" " %i:%v";

End-of-File

# Allow some time fo echo-out to be created
sleep 2

cat /tmp/echo-out

echo
echo "errors? ..."
_filter_pmie_log <$tmp.err

# success, all done
status=0
exit