-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update PAPI GitHub CI to reduce the number of tests and to add shlib …
…tests.
- Loading branch information
Treece Burgess
committed
Nov 7, 2024
1 parent
09fee01
commit 4a0a693
Showing
3 changed files
with
156 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
#!/bin/sh | ||
|
||
# File: run_tests_shlib.sh | ||
# Author: Treece Burgess | ||
# tburgess@icl.utk.edu | ||
|
||
# If the tests are not built then build them | ||
echo $BUILD | ||
if [ "x$BUILD" != "x" ]; then | ||
for comp in `ls components/*/tests` ; do \ | ||
cd components/$$comp/tests ; make; cd ../../.. ; | ||
done | ||
fi | ||
|
||
TESTS_QUIET="" | ||
# Determine if to suppress output or send to stdout | ||
if [ $# != 0 ]; then | ||
if [ $1 = "TESTS_QUIET" ]; then | ||
TESTS_QUIET=$1 | ||
else | ||
echo "Failed to quiet tests. Must pass TESTS_QUIET." | ||
echo "" | ||
fi | ||
fi | ||
|
||
# Determine if VALGRIND is set | ||
if [ "x$VALGRIND" != "x" ]; then | ||
VALGRIND="valgrind --leak-check=full"; | ||
fi | ||
|
||
# List of active components | ||
ACTIVE_COMPONENTS=$(utils/papi_component_avail | awk '/Active components:/{flag=1; next} flag' | grep "Name:" | sed 's/Name: //' | awk '{print $1}' | paste -sd' ' -) | ||
|
||
# Format active components to get inactive components | ||
ACTIVE_COMPONENTS_PATTERN=$(echo $ACTIVE_COMPONENTS | sed 's/ /|/g') | ||
|
||
# Find the test files, filtering for inactive components | ||
INACTIVE_COMPONENTS=$(find components/*/tests -perm -u+x -type f ! \( -name "*.[c|h]" -o -name "*.cu" -o -name "*.so" \) | grep -vE "components/($ACTIVE_COMPONENTS_PATTERN)/") | ||
|
||
EXCLUDE_TXT=`grep -v -e '^#\|^$' run_tests_exclude.txt` | ||
EXCLUDE_TESTS="$EXCLUDE_TXT $INACTIVE_COMPONENTS"; | ||
|
||
ACTIVE_COMPONENTS_TESTS="" | ||
for cmp in $ACTIVE_COMPONENTS; | ||
do | ||
query_cmp_test=$(find components/*/tests -perm -u+x -type f ! \( -name "*.[c|h]" -o -name "*.cu" -o -name "*.so" \) | grep -E -m 1 "components/($cmp)/") | ||
case $EXCLUDE_TESTS in | ||
*"$query_cmp_test"*) | ||
continue | ||
;; | ||
esac | ||
ACTIVE_COMPONENTS_TESTS="$ACTIVE_COMPONENTS_TESTS $query_cmp_test" | ||
done | ||
|
||
# System information | ||
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 [ "x$VALGRIND" != "x" ]; then | ||
echo "The following test cases will be run using valgrind:"; | ||
else | ||
echo "The following test cases will be run:"; | ||
fi | ||
|
||
# This List will only show a single test for each active component | ||
echo $ACTIVE_COMPONENTS_TESTS | ||
|
||
echo "" | ||
echo "The following test cases will NOT be run:"; | ||
echo $EXCLUDE_TESTS; | ||
|
||
# Set LD_LIBRARY_PATH | ||
if [ "$LD_LIBRARY_PATH" = "" ]; then | ||
LD_LIBRARY_PATH=.:./libpfm4/lib | ||
else | ||
LD_LIBRARY_PATH=.:./libpfm4/lib:"$LD_LIBRARY_PATH" | ||
fi | ||
export LD_LIBRARY_PATH | ||
|
||
echo ""; | ||
echo "Running a Single Component Test for --with-shlib-tools"; | ||
echo "" | ||
|
||
# Run a single component test | ||
for cmp_test in $ACTIVE_COMPONENTS_TESTS; | ||
do | ||
if [ -x $cmp_test ]; then | ||
printf "Running $cmp_test:\n"; | ||
printf "%-59s" "" | ||
if [ x$cmp == xsde ]; then | ||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PWD}/components/sde/sde_lib:${PWD}/components/sde/tests/lib $VALGRIND ./$cmp_test $TESTS_QUIET | ||
else | ||
$VALGRIND ./$cmp_test $TESTS_QUIET | ||
fi | ||
fi | ||
done |