summaryrefslogtreecommitdiff
path: root/tools/run-nm-test.sh
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-10-15 16:24:59 +0200
committerThomas Haller <thaller@redhat.com>2016-10-19 17:16:08 +0200
commit7aefbcb622f855b039d3c26d9a2f3b1ecaa84a5a (patch)
tree56c4c8af6a5fdb3854cb7bff64f30a754d77a12b /tools/run-nm-test.sh
parent9061432d5507718e29da4c659b46e5d129e006ed (diff)
downloadNetworkManager-7aefbcb622f855b039d3c26d9a2f3b1ecaa84a5a.tar.gz
build: merge "libnm/tests/Makefile.am" into toplevel Makefile
Diffstat (limited to 'tools/run-nm-test.sh')
-rwxr-xr-xtools/run-nm-test.sh40
1 files changed, 22 insertions, 18 deletions
diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh
index 809e95b739..34d30aab80 100755
--- a/tools/run-nm-test.sh
+++ b/tools/run-nm-test.sh
@@ -13,18 +13,22 @@ if [ "$1" == "--called-from-make" ]; then
shift
NMTST_LIBTOOL=($1 --mode=execute); shift
NMTST_VALGRIND="$1"; shift
+ NMTST_CHANGE_DIRECTORY=
+ if [[ "$NMTST_VALGRIND" == no ]]; then
+ NMTST_VALGRIND=
+ fi
SUPPRESSIONS="$1"; shift
if [ "$1" = "--launch-dbus" ]; then
NMTST_LAUNCH_DBUS=yes
shift
+ elif [ "$1" = "--launch-dbus=auto" ]; then
+ NMTST_LAUNCH_DBUS=
+ shift
else
NMTST_LAUNCH_DBUS=no
fi
TEST="$1"; shift
- if [[ "$NMTST_VALGRIND" == no ]]; then
- NMTST_VALGRIND=
- fi
else
if [ -n "${NMTST_LIBTOOL-:x}" ]; then
NMTST_LIBTOOL=(sh "$SCRIPT_PATH/../libtool" --mode=execute)
@@ -74,25 +78,25 @@ else
SUPPRESSIONS="$SCRIPT_PATH/../valgrind.suppressions"
fi
- [ -x "$TEST" ] || die "Test \"$TEST\" does not exist"
+fi
- TEST_PATH="$(readlink -f "$(dirname "$TEST")")"
+[ -x "$TEST" ] || die "Test \"$TEST\" does not exist"
+TEST_PATH="$(readlink -f "$(dirname "$TEST")")"
- if [ -n "${NMTST_LAUNCH_DBUS-x}" ]; then
- # autodetect whether to launch D-Bus based on the test path.
- if [[ $TEST_PATH == */libnm/tests || $TEST_PATH == */libnm-glib/tests ]]; then
- NMTST_LAUNCH_DBUS=yes
- else
- NMTST_LAUNCH_DBUS=no
- fi
+if [ -n "${NMTST_LAUNCH_DBUS:-x}" ]; then
+ # autodetect whether to launch D-Bus based on the test path.
+ if [[ $TEST_PATH == */libnm/tests || $TEST_PATH == */libnm-glib/tests ]]; then
+ NMTST_LAUNCH_DBUS=yes
+ else
+ NMTST_LAUNCH_DBUS=no
fi
+fi
- # some tests require you to cd into the base directory.
- # do that.
- if [ "$NMTST_VALGRIND_NO_CD" == "" ]; then
- cd "$TEST_PATH"
- TEST="./$(basename "$TEST")"
- fi
+# some tests require you to cd into the base directory.
+# do that.
+if [ "$NMTST_CHANGE_DIRECTORY" != "" ]; then
+ cd "$TEST_PATH"
+ TEST="./$(basename "$TEST")"
fi
NMTST_DBUS_RUN_SESSION=()