Skip to content

Commit

Permalink
run_tests.sh : Test only active components
Browse files Browse the repository at this point in the history
In the run_tests.sh script, when checking for components tests filter for active/inactive components.

Tested with the rocm and cuda components on Methane
  • Loading branch information
Dong Jun Woun committed Sep 9, 2024
1 parent 2151088 commit 3f742aa
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,22 @@ VTESTS=`find validation_tests/* -prune -perm -u+x -type f ! -name "*.[c|h]"`;
#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" -o -name "*.so" \)`;
#EXCLUDE=`grep --regexp=^# --invert-match run_tests_exclude.txt`
EXCLUDE=`grep -v -e '^#\|^$' run_tests_exclude.txt`



# List of active components
ACTIVE_COMPONENTS_PATTERN=$(utils/papi_component_avail | awk '/Active components:/{flag=1; next} flag' | grep "Name:" | sed 's/Name: //' | awk '{print $1}' | paste -sd'|' -)

# Find the test files, filtering for only the active components
COMPTESTS=$(find components/*/tests -perm -u+x -type f ! \( -name "*.[c|h]" -o -name "*.cu" -o -name "*.so" \) | grep -E "components/($ACTIVE_COMPONENTS_PATTERN)/")

# Find the test files, filtering for inactive components
INACTIVE_COMPTESTS=$(find components/*/tests -perm -u+x -type f ! \( -name "*.[c|h]" -o -name "*.cu" -o -name "*.so" \) | grep -vE "components/($ACTIVE_COMPONENTS_PATTERN)/")

#EXCLUDE=`grep --regexp=^# --invert-match run_tests_exclude.txt`
EXCLUDE_TXT=`grep -v -e '^#\|^$' run_tests_exclude.txt`
EXCLUDE="$EXCLUDE_TXT $INACTIVE_COMPTESTS";

ALLTESTS="$VTESTS $CTESTS $FTESTS $COMPTESTS";

PATH=./ctests:$PATH
Expand Down

0 comments on commit 3f742aa

Please sign in to comment.