Skip to content

Commit db74361

Browse files
committed
Run only given tests/examples under valgrind
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 7ae4fe1 commit db74361

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/test_valgrind.sh

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

1213
function print_usage() {
1314
echo "$(basename $0) - run all UMF tests and examples under a valgrind tool (memcheck, drd or helgrind)"
1415
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>"
16+
echo "Usage: $(basename $0) <workspace_dir> <build_dir> <memcheck|drd|helgrind> [tests_examples_to_be_run]"
1617
}
1718

1819
if ! valgrind --version > /dev/null; then
@@ -71,8 +72,14 @@ echo "Running: \"valgrind $OPTION\" for the following tests:"
7172
ANY_TEST_FAILED=0
7273
rm -f umf_test-*.log umf_test-*.err
7374

74-
for test in $(ls -1 ./test/umf_test-* ./examples/umf_example_*); do
75-
[ ! -x $test ] && continue
75+
[ "$TESTS" = "" ] && TESTS=$(ls -1 ./test/umf_test-* ./examples/umf_example_*)
76+
77+
for test in $TESTS; do
78+
if [ ! -x $test ]; then
79+
echo "$test does not exist or is not executable"
80+
exit 1
81+
fi
82+
7683
echo "$test - starting ..."
7784
echo -n "$test "
7885
LOG=${test}.log

0 commit comments

Comments
 (0)