summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKarel Zak2017-11-23 14:03:23 +0100
committerKarel Zak2017-11-23 14:03:23 +0100
commitd3f58f8aee3f286ec0565d15758acbcf65f69ae0 (patch)
tree2b08075eec488ffe77c8b463b0391c2c04d0f0ed /tests
parenttests: rename ts_valgrind to ts_run (diff)
downloadkernel-qcow2-util-linux-d3f58f8aee3f286ec0565d15758acbcf65f69ae0.tar.gz
kernel-qcow2-util-linux-d3f58f8aee3f286ec0565d15758acbcf65f69ae0.tar.xz
kernel-qcow2-util-linux-d3f58f8aee3f286ec0565d15758acbcf65f69ae0.zip
tests: rename --memcheck to --memcheck-valgrind
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functions.sh27
-rwxr-xr-xtests/run.sh22
2 files changed, 29 insertions, 20 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index 58db7475f..7152a4e33 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -280,7 +280,7 @@ function ts_init_env {
TS_PARSABLE=$(ts_has_option "parsable" "$*")
[ "$TS_PARSABLE" = "yes" ] || TS_PARSABLE="$TS_PARALLEL"
- tmp=$( ts_has_option "memcheck" "$*")
+ tmp=$( ts_has_option "memcheck-valgrind" "$*")
if [ "$tmp" == "yes" -a -f /usr/bin/valgrind ]; then
TS_VALGRIND_CMD="/usr/bin/valgrind"
fi
@@ -377,12 +377,19 @@ function ts_init_py {
}
function ts_run {
- if [ -z "$TS_VALGRIND_CMD" ]; then
- "$@"
- else
+ #
+ # valgrind mode
+ #
+ if [ -n "$TS_VALGRIND_CMD" ]; then
$TS_VALGRIND_CMD --tool=memcheck --leak-check=full \
--leak-resolution=high --num-callers=20 \
--log-file="$TS_VGDUMP" "$@"
+
+ #
+ # Default mode
+ #
+ else
+ "$@"
fi
}
@@ -415,11 +422,13 @@ function ts_gen_diff {
}
function tt_gen_mem_report {
- [ -z "$TS_VALGRIND_CMD" ] && echo "$1"
-
- grep -q -E 'ERROR SUMMARY: [1-9]' $TS_VGDUMP &> /dev/null
- if [ $? -eq 0 ]; then
- echo "mem-error detected!"
+ if [ -n "$TS_VALGRIND_CMD" ]; then
+ grep -q -E 'ERROR SUMMARY: [1-9]' $TS_VGDUMP &> /dev/null
+ if [ $? -eq 0 ]; then
+ echo "mem-error detected!"
+ fi
+ else
+ echo "$1"
fi
}
diff --git a/tests/run.sh b/tests/run.sh
index 071fb8f5f..1d4cc9d21 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -45,7 +45,7 @@ while [ -n "$1" ]; do
case "$1" in
--force |\
--fake |\
- --memcheck |\
+ --memcheck-valgrind |\
--show-diff |\
--verbose |\
--skip-loopdevs |\
@@ -79,16 +79,16 @@ while [ -n "$1" ]; do
echo "Usage: "
echo " $(basename $0) [options] [<component> ...]"
echo "Options:"
- echo " --force execute demanding tests"
- echo " --fake do not run, setup tests only"
- echo " --memcheck run with valgrind"
- echo " --verbose verbose mode"
- echo " --show-diff show diff from failed tests"
- echo " --nonroot ignore test suite if user is root"
- echo " --srcdir=<path> autotools top source directory"
- echo " --builddir=<path> autotools top build directory"
- echo " --parallel=<num> number of parallel test jobs, default: num cpus"
- echo " --exclude=<list> exclude tests by list '<utilname>/<testname> ..'"
+ echo " --force execute demanding tests"
+ echo " --fake do not run, setup tests only"
+ echo " --memcheck-valgrind run with valgrind"
+ echo " --verbose verbose mode"
+ echo " --show-diff show diff from failed tests"
+ echo " --nonroot ignore test suite if user is root"
+ echo " --srcdir=<path> autotools top source directory"
+ echo " --builddir=<path> autotools top build directory"
+ echo " --parallel=<num> number of parallel test jobs, default: num cpus"
+ echo " --exclude=<list> exclude tests by list '<utilname>/<testname> ..'"
echo
exit 1
;;