@@ -10,8 +10,8 @@ BUILD_DIR=$2
10
10
TOOL=$3
11
11
12
12
function print_usage() {
13
- echo " $( basename $0 ) - run all UMF tests under a valgrind tool (memcheck, drd or helgrind)"
14
- echo " This script looks for './test/umf_test-*' test executables in the UMF build directory."
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
15
echo " Usage: $( basename $0 ) <workspace_dir> <build_dir> <memcheck|drd|helgrind>"
16
16
}
17
17
58
58
WORKSPACE=$( realpath $WORKSPACE )
59
59
BUILD_DIR=$( realpath $BUILD_DIR )
60
60
61
- cd ${BUILD_DIR} /test/
61
+ cd ${BUILD_DIR}
62
62
mkdir -p cpuid
63
63
64
64
echo " Gathering data for hwloc so it can be run under valgrind:"
@@ -71,74 +71,83 @@ echo "Running: \"valgrind $OPTION\" for the following tests:"
71
71
ANY_TEST_FAILED=0
72
72
rm -f umf_test-* .log umf_test-* .err
73
73
74
- for test in $( ls -1 umf_test-* ) ; do
74
+ for test in $( ls -1 ./test/ umf_test-* ./examples/umf_example_ * ) ; do
75
75
[ ! -x $test ] && continue
76
76
echo " $test - starting ..."
77
77
echo -n " $test "
78
78
LOG=${test} .log
79
79
ERR=${test} .err
80
- SUP=" ${WORKSPACE} /test/supp/${TOOL} -${test} .supp"
80
+ NAME=$( basename $test )
81
+ SUP=" ${WORKSPACE} /test/supp/${TOOL} -${NAME} .supp"
81
82
OPT_SUP=" "
82
- [ -f ${SUP} ] && OPT_SUP=" --suppressions=${SUP} " && echo -n " (${TOOL} - ${test} .supp ) "
83
+ [ -f ${SUP} ] && OPT_SUP=" --suppressions=${SUP} " && echo -n " ($( basename ${SUP} ) ) "
83
84
84
85
# skip tests incompatible with valgrind
85
86
FILTER=" "
86
87
case $test in
87
- umf_test-disjointPool)
88
+ ./test/ umf_test-disjointPool)
88
89
if [ " $TOOL " = " helgrind" ]; then
89
90
# skip because of the assert in helgrind:
90
91
# Helgrind: hg_main.c:308 (lockN_acquire_reader): Assertion 'lk->kind == LK_rdwr' failed.
91
92
echo " - SKIPPED (helgrind only)"
92
93
continue ;
93
94
fi
94
95
;;
95
- umf_test-ipc_os_prov_* )
96
+ ./test/ umf_test-ipc_os_prov_* )
96
97
echo " - SKIPPED"
97
98
continue ; # skip testing helper binaries used by the ipc_os_prov_* tests
98
99
;;
99
- umf_test-ipc_devdax_prov_* )
100
+ ./test/ umf_test-ipc_devdax_prov_* )
100
101
echo " - SKIPPED"
101
102
continue ; # skip testing helper binaries used by the ipc_devdax_prov_* tests
102
103
;;
103
- umf_test-ipc_file_prov_* )
104
+ ./test/ umf_test-ipc_file_prov_* )
104
105
echo " - SKIPPED"
105
106
continue ; # skip testing helper binaries used by the ipc_file_prov_* tests
106
107
;;
107
- umf_test-memspace_host_all)
108
+ ./test/ umf_test-memspace_host_all)
108
109
FILTER=' --gtest_filter="-*allocsSpreadAcrossAllNumaNodes"'
109
110
;;
110
- umf_test-provider_os_memory)
111
+ ./test/ umf_test-provider_os_memory)
111
112
FILTER=' --gtest_filter="-osProviderTest/umfIpcTest*"'
112
113
;;
113
- umf_test-provider_os_memory_config)
114
+ ./test/ umf_test-provider_os_memory_config)
114
115
FILTER=' --gtest_filter="-*protection_flag_none:*protection_flag_read:*providerConfigTestNumaMode*"'
115
116
;;
116
- umf_test-memspace_highest_capacity)
117
+ ./test/ umf_test-memspace_highest_capacity)
117
118
FILTER=' --gtest_filter="-*highestCapacityVerify*"'
118
119
;;
119
- umf_test-provider_os_memory_multiple_numa_nodes)
120
+ ./test/ umf_test-provider_os_memory_multiple_numa_nodes)
120
121
FILTER=' --gtest_filter="-testNuma.checkModeInterleave*:testNumaNodesAllocations/testNumaOnEachNode.checkNumaNodesAllocations*:testNumaNodesAllocations/testNumaOnEachNode.checkModePreferred*:testNumaNodesAllocations/testNumaOnEachNode.checkModeInterleaveSingleNode*:testNumaNodesAllocationsAllCpus/testNumaOnEachCpu.checkModePreferredEmptyNodeset*:testNumaNodesAllocationsAllCpus/testNumaOnEachCpu.checkModeLocal*"'
121
122
;;
122
- umf_test-memspace_highest_bandwidth)
123
+ ./test/ umf_test-memspace_highest_bandwidth)
123
124
FILTER=' --gtest_filter="-*allocLocalMt*"'
124
125
;;
125
- umf_test-memspace_lowest_latency)
126
+ ./test/ umf_test-memspace_lowest_latency)
126
127
FILTER=' --gtest_filter="-*allocLocalMt*"'
127
128
;;
128
- umf_test-memoryPool)
129
+ ./test/ umf_test-memoryPool)
129
130
FILTER=' --gtest_filter="-*allocMaxSize*"'
130
131
;;
132
+ ./examples/umf_example_ipc_ipcapi_* )
133
+ echo " - SKIPPED"
134
+ continue ; # skip testing helper binaries used by the umf_example_ipc_ipcapi_* examples
135
+ ;;
131
136
esac
132
137
133
138
[ " $FILTER " != " " ] && echo -n " ($FILTER ) "
134
139
135
140
LAST_TEST_FAILED=0
136
-
137
- if ! HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all ./$test $FILTER > $LOG 2>&1 ; then
141
+ set +e
142
+ HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all $test $FILTER > $LOG 2>&1
143
+ RET=$?
144
+ set -e
145
+ # 125 is the return code when the test is skipped
146
+ if [ $RET -ne 0 -a $RET -ne 125 ]; then
138
147
LAST_TEST_FAILED=1
139
148
ANY_TEST_FAILED=1
140
- echo " (valgrind FAILED) "
141
- echo " Command: HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all ./ $test $FILTER >$LOG 2>&1"
149
+ echo " (valgrind FAILED RV= $RET ) "
150
+ echo " Command: HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all $test $FILTER >$LOG 2>&1"
142
151
echo " Output:"
143
152
cat $LOG
144
153
echo " ====================="
@@ -147,7 +156,7 @@ for test in $(ls -1 umf_test-*); do
147
156
# grep for "ERROR SUMMARY" with errors (there can be many lines with "ERROR SUMMARY")
148
157
grep -e " ERROR SUMMARY:" $LOG | grep -v -e " ERROR SUMMARY: 0 errors from 0 contexts" > $ERR || true
149
158
if [ $LAST_TEST_FAILED -eq 0 -a $( cat $ERR | wc -l) -eq 0 ]; then
150
- echo " - OK"
159
+ [ $RET -eq 0 ] && echo " - OK" || echo " - SKIPPED "
151
160
rm -f $LOG $ERR
152
161
else
153
162
echo " - FAILED!"
0 commit comments