From c173ad8e07b293ec3eb27c259b636a6d60e6a6e9 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Thu, 19 May 2022 12:10:05 -0400 Subject: [PATCH] run_kfdtest.sh: Add --exclude flag to exclude additional subtests Currently, using --gtest_filter will override any exclusions from kfdtest.exclude. To add an additional test (or set of tests) to the exclusion list dynamically, the --exclude (-e) flag will allow the user to pass in a string of GTest-style exclusions to add to the list generated by kfdtest.exclude e.g. run_kfdtest.sh -e "*KFDLocalMemoryTest.*:KFDEventTest.*" will use kfdtest.exclude, but will also exclude all LocalMemory and Event tests Change-Id: Ic23ec271ba2cd2240d2e98558c0117ff2a064ed2 [ROCm/ROCR-Runtime commit: f7978b1ff6c31eb5eb48f2a560281bf5c7109413] --- .../tests/kfdtest/scripts/run_kfdtest.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh b/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh index 6311e1b9a5..f6a5a9b95d 100755 --- a/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh +++ b/projects/rocr-runtime/tests/kfdtest/scripts/run_kfdtest.sh @@ -80,6 +80,7 @@ GDB="" NODE="" FORCE_HIGH="" RUN_IN_DOCKER="" +ADDITIONAL_EXCLUDE="" printUsage() { echo @@ -95,6 +96,7 @@ printUsage() { echo " -l , --list List available nodes" echo " --high Force clocks to high for test execution" echo " -d , --docker Run in docker container" + echo " -e , --exclude Additional tests to exclude, in addition to kfdtest.exclude (colon-separated, single quoted string as an argument)" echo " -h , --help Prints this help" echo echo "Gtest arguments will be forwarded to the app" @@ -122,6 +124,9 @@ getFilter() { gtestFilter="--gtest_filter=${FILTER[$platform]}" ;; esac + if [ -n "$ADDITIONAL_EXCLUDE" ]; then + gtestFilter="$gtestFilter:$ADDITIONAL_EXCLUDE" + fi } TOPOLOGY_SYSFS_DIR=/sys/devices/virtual/kfd/kfd/topology/nodes @@ -168,6 +173,11 @@ runKfdTest() { PKG_ROOT="$(getPackageRoot)" fi + if [ -n "$GTEST_ARGS" ] && [ -n "$ADDITIONAL_EXCLUDE" ]; then + echo "Cannot use -e and --gtest_filter flags together" + exit 0 + fi + if [ "$NODE" == "" ]; then hsaNodes=$(getHsaNodes) @@ -242,6 +252,8 @@ while [ "$1" != "" ]; do FORCE_HIGH="true" ;; -d | --docker ) RUN_IN_DOCKER="true" ;; + -e | --exclude ) + ADDITIONAL_EXCLUDE="$2" ; shift ;; -h | --help ) printUsage; exit 0 ;; *)