qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / 446
blob1dffa0e45d0997c8a14fe6c1fa0b854169a114a7
1 #! /bin/sh
2 # PCP QA Test No. 446
3 # checks contents of trace stub library
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 if [ $PCP_PLATFORM = irix ]
17 then
18 NM_ARG='-B'
19 libmajor=1
20 DSO_VERSION=$DSO_SUFFIX.$libmajor
21 elif [ $PCP_PLATFORM = linux -o $PCP_PLATFORM = solaris ]
22 then
23 # same options for Linux and OpenSolaris
24 NM_ARG='--dynamic -B'
25 libmajor=2
26 DSO_VERSION=$DSO_SUFFIX.$libmajor
27 elif [ $PCP_PLATFORM = darwin ]
28 then
29 NM_ARG=''
30 libmajor=2
31 DSO_VERSION=$libmajor.$DSO_SUFFIX
32 else
33 echo "Arrgh ... need configuration for $PCP_PLATFORM"
34 exit 1
37 [ -f $PCP_LIB_DIR/libpcp_trace.$DSO_VERSION ] || _notrun "No trace shared library available"
39 status=1 # failure is the default!
40 trap "$sudo rm -f $tmp.*; exit \$status" 0 1 2 3 15
42 # real QA test starts here
43 get_syms()
45 # gets all code symbols, prints the name, & strips internal names
46 nm $NM_ARG $1 | grep " T " | $PCP_AWK_PROG '{print $3}' | grep -v "_" | grep -v "^.MIPS."
49 # real QA test starts here
50 cd $PCP_DEMOS_DIR/trace
51 unset ROOT TOOLROOT MAKEFLAGS
52 $sudo make -f Makefile.stub clobber 2>&1 >/dev/null
53 $sudo make -f Makefile.stub lib/libpcp_trace.$DSO_VERSION 2>&1 >$tmp.make
54 if [ $? -ne 0 ]
55 then
56 echo Stub library make failed. Heres the make output ...
57 cat $tmp.make
58 else
59 echo make succeeded.
62 get_syms $PCP_LIB_DIR/libpcp_trace.$DSO_VERSION > $tmp.actual
63 get_syms $PCP_DEMOS_DIR/trace/lib/libpcp_trace.$DSO_VERSION > $tmp.stub
65 diff $tmp.actual $tmp.stub >/dev/null
66 status=$?
68 $PCP_ECHO_PROG $PCP_ECHO_N "checking for actual/stub lib symbol differences ... ""$PCP_ECHO_C"
69 if [ $status -ne 0 ]
70 then
71 $PCP_ECHO_PROG files differ.
72 echo "--- Symbols from /usr/lib/libpcp_trace.... ---"
73 cat $tmp.actual
74 echo
75 echo "--- Symbols from demos libpcp_trace.... ---"
76 cat $tmp.stub
77 else
78 $PCP_ECHO_PROG none found.
81 exit