/usr/share/doc/papi-examples/run_tests.sh is in papi-examples 5.3.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | #!/bin/sh
# File: papi.c
# CVS: $Id$
# Author: Philip Mucci
# mucci@cs.utk.edu
# Mods: Kevin London
# london@cs.utk.edu
# Philip Mucci
# mucci@cs.utk.edu
# if make sure that the tests are built
if [ "x$BUILD" != "x" ]; then
cd testlib; make; cd ..
cd ctests; make; cd ..
cd ftests; make; cd ..
for comp in `ls components/*/tests` ; do \
cd components/$$comp/tests ; make; cd ../../.. ;
done
fi
AIXTHREAD_SCOPE=S
export AIXTHREAD_SCOPE
if [ "X$1" = "X-v" ]; then
shift ; TESTS_QUIET=""
else
# This should never have been an argument, but an environment variable!
TESTS_QUIET="TESTS_QUIET"
export TESTS_QUIET
fi
if [ "x$VALGRIND" != "x" ]; then
VALGRIND="valgrind --leak-check=full";
fi
#CTESTS=`find ctests -maxdepth 1 -perm -u+x -type f`;
CTESTS=`find ctests/* -prune -perm -u+x -type f ! -name "*.[c|h]"`;
FTESTS=`find ftests -perm -u+x -type f ! -name "*.[c|h|F]"`;
COMPTESTS=`find components/*/tests -perm -u+x -type f ! \( -name "*.[c|h]" -o -name "*.cu" \)`;
#EXCLUDE=`grep --regexp=^# --invert-match run_tests_exclude.txt`
EXCLUDE=`grep -v -e '^#\|^$' run_tests_exclude.txt`
ALLTESTS="$CTESTS $FTESTS $COMPTESTS";
x=0;
CWD=`pwd`
PATH=./ctests:$PATH
export PATH
echo "Platform:"
uname -a
echo "Date:"
date
echo ""
if [ -r /proc/cpuinfo ]; then
echo "Cpuinfo:"
# only print info on first processor on x86
sed '/^$/q' /proc/cpuinfo
fi
echo ""
if ["$VALGRIND" = ""]; then
echo "The following test cases will be run:";
else
echo "The following test cases will be run using valgrind:";
fi
echo ""
MATCH=0
LIST=""
for i in $ALLTESTS;
do
for xtest in $EXCLUDE;
do
if [ "$i" = "$xtest" ]; then
MATCH=1
break
fi;
done
if [ `basename $i` = "Makefile" ]; then
MATCH=1
fi;
if [ $MATCH -ne 1 ]; then
LIST="$LIST $i"
fi;
MATCH=0
done
echo $LIST
echo ""
CUDA=`find Makefile | xargs grep cuda`;
if [ "$CUDA" != "" ]; then
EXCLUDE="$EXCLUDE `grep -v -e '^#\|^$' run_tests_exclude_cuda.txt`"
fi
echo ""
echo "The following test cases will NOT be run:";
echo $EXCLUDE;
echo "";
echo "Running C Tests";
echo ""
if [ "$LD_LIBRARY_PATH" = "" ]; then
LD_LIBRARY_PATH=.:./libpfm-3.y/lib
else
LD_LIBRARY_PATH=.:./libpfm-3.y/lib:"$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH
if [ "$LIBPATH" = "" ]; then
LIBPATH=.:./libpfm-3.y/lib
else
LIBPATH=.:./libpfm-3.y/lib:"$LIBPATH"
fi
export LIBPATH
for i in $CTESTS;
do
for xtest in $EXCLUDE;
do
if [ "$i" = "$xtest" ]; then
MATCH=1
break
fi;
done
if [ `basename $i` = "Makefile" ]; then
MATCH=1
fi;
if [ $MATCH -ne 1 ]; then
if [ -x $i ]; then
if [ "$i" = "ctests/timer_overflow" ]; then
echo Skipping test $i, it takes too long...
else
RAN="$i $RAN"
printf "Running $i:";
$VALGRIND ./$i $TESTS_QUIET
fi;
fi;
fi;
MATCH=0
done
echo ""
echo "Running Fortran Tests";
echo ""
for i in $FTESTS;
do
for xtest in $EXCLUDE;
do
if [ "$i" = "$xtest" ]; then
MATCH=1
break
fi;
done
if [ `basename $i` = "Makefile" ]; then
MATCH=1
fi;
if [ $MATCH -ne 1 ]; then
if [ -x $i ]; then
RAN="$i $RAN"
printf "Running $i:";
$VALGRIND ./$i $TESTS_QUIET
fi;
fi;
MATCH=0
done
echo "";
echo "Running Component Tests";
echo ""
for i in $COMPTESTS;
do
for xtest in $EXCLUDE;
do
if [ "$i" = "$xtest" ]; then
MATCH=1
break
fi;
done
if [ `basename $i` = "Makefile" ]; then
MATCH=1
fi;
if [ $MATCH -ne 1 ]; then
if [ -x $i ]; then
RAN="$i $RAN"
printf "Running $i:";
$VALGRIND ./$i $TESTS_QUIET
fi;
fi;
MATCH=0
done
if [ "$RAN" = "" ]; then
echo "FAILED to run any tests. (you can safely ignore this if this was expected behavior)"
fi;
|