Skip to content

Commit 95e2410

Browse files
Merge pull request #1006 from ldorau/Run_only_given_tests_examples_under_valgrind
Run DAX and multi-NUMA tests under valgrind
2 parents 88bb108 + 96b00ee commit 95e2410

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

.github/workflows/reusable_dax.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ env:
3131
INSTL_DIR : "${{github.workspace}}/../install-dir"
3232
COVERAGE_DIR : "${{github.workspace}}/coverage"
3333
COVERAGE_NAME : "exports-coverage-dax"
34+
DAX_TESTS: "./test/umf_test-provider_file_memory ./test/umf_test-provider_devdax_memory"
3435

3536
jobs:
3637
dax:
@@ -126,6 +127,12 @@ jobs:
126127
UMF_TESTS_FSDAX_PATH_2=${{env.UMF_TESTS_FSDAX_PATH_2}}
127128
ctest -C ${{matrix.build_type}} -V -R "file|fsdax"
128129
130+
- name: Run DAX tests under valgrind
131+
run: |
132+
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} memcheck "${{env.DAX_TESTS}}"
133+
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} drd "${{env.DAX_TESTS}}"
134+
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} helgrind "${{env.DAX_TESTS}}"
135+
129136
- name: Check coverage
130137
if: ${{ matrix.build_type == 'Debug' }}
131138
working-directory: ${{env.BUILD_DIR}}

.github/workflows/reusable_multi_numa.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
BUILD_DIR : "${{github.workspace}}/build"
1111
COVERAGE_DIR : "${{github.workspace}}/coverage"
1212
COVERAGE_NAME : "exports-coverage-multinuma"
13+
NUMA_TESTS: "./test/umf_test-memspace_numa ./test/umf_test-provider_os_memory_multiple_numa_nodes"
1314

1415
jobs:
1516
multi_numa:
@@ -68,6 +69,13 @@ jobs:
6869
./test/umf_test-provider_os_memory_multiple_numa_nodes \
6970
--gtest_filter="-*checkModeLocal/*:*checkModePreferredEmptyNodeset/*:testNuma.checkModeInterleave"
7071
72+
- name: Run NUMA tests under valgrind
73+
if: matrix.os != 'rhel-9.1'
74+
run: |
75+
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} memcheck "${{env.NUMA_TESTS}}"
76+
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} drd "${{env.NUMA_TESTS}}"
77+
${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{env.BUILD_DIR}} helgrind "${{env.NUMA_TESTS}}"
78+
7179
- name: Check coverage
7280
if: ${{ matrix.build_type == 'Debug' && matrix.os == 'ubuntu-22.04' }}
7381
working-directory: ${{env.BUILD_DIR}}

test/test_valgrind.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ set -e
88
WORKSPACE=$1
99
BUILD_DIR=$2
1010
TOOL=$3
11+
TESTS=$4
1112

1213
function print_usage() {
13-
echo "$(basename $0) - run all UMF tests and examples under a valgrind tool (memcheck, drd or helgrind)"
14-
echo "This script looks for './test/umf_test-*' and './examples/umf_example_*' executables in the UMF build directory."
15-
echo "Usage: $(basename $0) <workspace_dir> <build_dir> <memcheck|drd|helgrind>"
14+
echo "$(basename $0) - run UMF tests and examples under a valgrind tool (memcheck, drd or helgrind)"
15+
echo "Usage: $(basename $0) <workspace_dir> <build_dir> <memcheck|drd|helgrind> [tests_examples]"
16+
echo "Where:"
17+
echo
18+
echo "tests_examples - (optional) list of tests or examples to be run (paths relative to the <build_dir> build directory)."
19+
echo " If it is empty, all tests (./test/umf_test-*) and examples (./examples/umf_example_*)"
20+
echo " found in <build_dir> will be run."
1621
}
1722

1823
if ! valgrind --version > /dev/null; then
@@ -62,7 +67,7 @@ cd ${BUILD_DIR}
6267
mkdir -p cpuid
6368

6469
echo "Gathering data for hwloc so it can be run under valgrind:"
65-
hwloc-gather-cpuid ./cpuid
70+
hwloc-gather-cpuid ./cpuid >/dev/null
6671

6772
echo
6873
echo "Working directory: $(pwd)"
@@ -71,7 +76,14 @@ echo "Running: \"valgrind $OPTION\" for the following tests:"
7176
ANY_TEST_FAILED=0
7277
rm -f umf_test-*.log umf_test-*.err
7378

74-
for test in $(ls -1 ./test/umf_test-* ./examples/umf_example_*); do
79+
[ "$TESTS" = "" ] && TESTS=$(ls -1 ./test/umf_test-* ./examples/umf_example_*)
80+
81+
for test in $TESTS; do
82+
if [ ! -f $test ]; then
83+
echo
84+
echo "error: the $test (${BUILD_DIR}/$test) file does not exist"
85+
exit 1
86+
fi
7587
[ ! -x $test ] && continue
7688
echo "$test - starting ..."
7789
echo -n "$test "

0 commit comments

Comments
 (0)