File: 446

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 (84 lines) | stat: -rwxr-xr-x 2,164 bytes parent folder | download | duplicates (4)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
#! /bin/sh
# PCP QA Test No. 446
# checks contents of trace stub library
#
# 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

if [ $PCP_PLATFORM = linux -o $PCP_PLATFORM = solaris -o $PCP_PLATFORM = freebsd -o $PCP_PLATFORM = netbsd -o $PCP_PLATFORM = openbsd ]
then
    # same options for all these platforms
    NM_ARG='--dynamic -B'
    libmajor=2
    DSO_VERSION=$DSO_SUFFIX.$libmajor
elif [ $PCP_PLATFORM = darwin ]
then
    NM_ARG=''
    libmajor=2
    DSO_VERSION=$libmajor.$DSO_SUFFIX
else
    echo "Arrgh ... need configuration for PCP_PLATFORM $PCP_PLATFORM"
    exit 1
fi

[ -f $PCP_LIB_DIR/libpcp_trace.$DSO_VERSION ] || _notrun "No trace shared library available"

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

# real QA test starts here
get_syms()
{
    # gets all code symbols, prints the name, & strips internal names
    nm $NM_ARG $1 \
    | $PCP_AWK_PROG '/ T / {print $3}' \
    | grep -v "^_" \
    | grep -v "^.MIPS." \
    | sed \
	-e 's/@@PCP_TRACE.*//' \
	-e 's/_$//' \
    | LC_COLLATE=POSIX sort \
    | uniq
}

# real QA test starts here
cd $PCP_DEMOS_DIR/trace
unset ROOT TOOLROOT MAKEFLAGS
$sudo $PCP_MAKE_PROG -f Makefile.stub clobber 2>&1 >/dev/null
$sudo $PCP_MAKE_PROG -f Makefile.stub lib/libpcp_trace.$DSO_VERSION 2>&1 >$tmp.make
if [ $? -ne 0 ]
then
    echo Stub library make failed.  Heres the make output ...
    cat $tmp.make
else
    echo make succeeded.
fi

get_syms $PCP_LIB_DIR/libpcp_trace.$DSO_VERSION > $tmp.actual
get_syms $PCP_DEMOS_DIR/trace/lib/libpcp_trace.$DSO_VERSION > $tmp.stub

diff $tmp.actual $tmp.stub >/dev/null
status=$?

$PCP_ECHO_PROG $PCP_ECHO_N "checking for actual/stub lib symbol differences ... ""$PCP_ECHO_C"
if [ $status -ne 0 ]
then
    $PCP_ECHO_PROG files differ.
    echo "--- Symbols from /usr/lib/libpcp_trace.... ---"
    cat $tmp.actual
    echo
    echo "--- Symbols from demos libpcp_trace.... ---"
    cat $tmp.stub
else
     $PCP_ECHO_PROG none found.
fi

exit