qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 521
blob90180581790f1b7064163250d0347e3c9b5596ce
1 #!/bin/sh
2 # PCP QA Test No. 521
3 # pmie unit scale factors and predefined macro tests
5 # Copyright (c) 2012 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 "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 _filter()
22 sed \
23 -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/' \
24 -e 's/DATE [12][0-9][0-9][0-9]/DATE/' \
25 -e '/evaluator exiting/s/pmie([0-9][0-9]*)/pmie(PID)/' \
26 -e '/Performance Co-Pilot Inference Engine/s/Version .*/Version .../' \
27 -e '/^raw_/d'
30 cat <<'End-of-File' >$tmp.pmie
31 // scale factors
32 nanosecond_microsecond = sample.long.hundred * 10nanosecond == 1microsecond;
33 nanosec_microsec = sample.long.hundred * 10 nanosec == 1 microsec;
34 nsec_usec = sample.long.hundred * 10nsec == 1usec;
35 millisecond_second = sample.long.ten * 100millisecond == 1second;
36 millisec_sec = sample.long.ten * 100 millisec == 1 sec;
37 msec_min = sample.long.ten * 600msec == 6sec;
38 second_minute = sample.long.one * 1second == 1minute / 60;
39 sec_min = sample.long.one * 1 sec == 1 min / 60;
40 hour_min = sample.long.one * 1 hour == 60 min;
41 byte_Kbyte = sample.long.one * 1024 byte == 1 Kbyte;
42 Mbyte_Gbyte = sample.long.one * 1024 Mbyte == 1 Gbyte;
43 Gbyte_Tbyte = sample.long.one * 1024 Gbyte == 1 Tbyte;
44 count_Kcount = sample.long.one * 1000 count == 1 Kcount;
45 Kcount_Mcount = sample.long.one * 1Kcount == 1Mcount/1000;
47 // predefined macros
48 raw_minute_macro = $minute;
49 minute_macro = ($minute >= 00) && ($minute <= 59);
50 raw_hour_macro = $hour;
51 hour_macro = ($hour >= 00) && ($hour <= 23);
52 raw_day_macro = $day;
53 day_macro = ($day >= 1) && ($day <= 31);
54 raw_day_of_week_macro = $day_of_week;
55 day_of_week_macro = ($day_of_week >= 0) && ($day_of_week <= 6);
56 raw_year_macro = $year;
57 year_macro = $year > 2012;
58 raw_delta_macro = $delta;
59 delta_macro = $delta == 0.5;
60 End-of-File
62 # real QA test starts here
63 pmie -c $tmp.pmie -t 500msec -T900msec -v >$tmp.out 2>$tmp.err
65 echo "=== pmie output ===" >>$seq.full
66 cat $tmp.out >>$seq.full
67 echo >>$seq.full
68 echo "=== pmie errors ===" >>$seq.full
69 cat $tmp.err >>$seq.full
71 _filter <$tmp.err
72 _filter <$tmp.out
74 # success, all done
75 status=0
76 exit