[lttng-dev] [PATCH lttng-tools 2/5] Fix: tests: skip tests on static build

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu May 12 20:08:44 UTC 2016


Skip tests that depend on shared objects on static build rather than
bailing out, which will let the overall test suite succeed.

Fixes: #977

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
 tests/regression/tools/health/test_health.sh              | 12 ++++++++----
 tests/regression/ust/clock-override/test_clock_override   | 12 ++++++++----
 tests/regression/ust/getcpu-override/test_getcpu_override | 12 ++++++++----
 tests/regression/ust/overlap/test_overlap                 | 12 ++++++++----
 tests/regression/ust/ust-dl/test_ust-dl                   |  3 ++-
 5 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/tests/regression/tools/health/test_health.sh b/tests/regression/tools/health/test_health.sh
index 40d2f9e..bc25caa 100644
--- a/tests/regression/tools/health/test_health.sh
+++ b/tests/regression/tools/health/test_health.sh
@@ -25,10 +25,6 @@ SLEEP_TIME=30
 
 source $TESTDIR/utils/utils.sh
 
-if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
-	BAIL_OUT "${CURDIR}/${SESSIOND_PRELOAD} is missing."
-fi
-
 function lttng_create_session_uri
 {
 	# Create session with default path
@@ -163,6 +159,14 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
+if [ -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
+	foundobj=1
+else
+	foundobj=0
+fi
+
+skip $foundobj "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
+
 THREAD=("LTTNG_SESSIOND_THREAD_MANAGE_CLIENTS"
 	"LTTNG_SESSIOND_THREAD_MANAGE_APPS"
 	"LTTNG_SESSIOND_THREAD_REG_APPS"
diff --git a/tests/regression/ust/clock-override/test_clock_override b/tests/regression/ust/clock-override/test_clock_override
index f4a5fea..722e731 100755
--- a/tests/regression/ust/clock-override/test_clock_override
+++ b/tests/regression/ust/clock-override/test_clock_override
@@ -49,10 +49,6 @@ NUM_TESTS=33
 
 source $TESTDIR/utils/utils.sh
 
-if [ ! -x "$CURDIR/$LIBS_DIR/$LTTNG_UST_CLOCK_PLUGIN_SO" ]; then
-	BAIL_OUT "No shared object generated"
-fi
-
 # MUST set TESTDIR before calling those functions
 function run_app()
 {
@@ -167,6 +163,14 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
+if [ -x "$CURDIR/$LIBS_DIR/$LTTNG_UST_CLOCK_PLUGIN_SO" ]; then
+	foundobj=1
+else
+	foundobj=0
+fi
+
+skip $foundobj "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
+
 TESTS=(
 	"test_getcpu_override_metadata"
 	"test_getcpu_override_timestamp"
diff --git a/tests/regression/ust/getcpu-override/test_getcpu_override b/tests/regression/ust/getcpu-override/test_getcpu_override
index f140eea..4ca385a 100755
--- a/tests/regression/ust/getcpu-override/test_getcpu_override
+++ b/tests/regression/ust/getcpu-override/test_getcpu_override
@@ -50,10 +50,6 @@ source $TESTDIR/utils/utils.sh
 # Equivalent to the syconf(_SC_NPROCESSORS_CONF) call.
 num_cpus=$(conf_proc_count)
 
-if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
-	BAIL_OUT "No shared object generated"
-fi
-
 # MUST set TESTDIR before calling those functions
 
 run_app()
@@ -161,6 +157,14 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
+if [ -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then
+	foundobj=1
+else
+	foundobj=0
+fi
+
+skip $foundobj "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0
+
 TESTS=(
 	test_getcpu_override_fail
 	test_getcpu_override
diff --git a/tests/regression/ust/overlap/test_overlap b/tests/regression/ust/overlap/test_overlap
index 69d6c66..66c55ca 100755
--- a/tests/regression/ust/overlap/test_overlap
+++ b/tests/regression/ust/overlap/test_overlap
@@ -34,10 +34,6 @@ NUM_TESTS=259
 
 source $TESTDIR/utils/utils.sh
 
-if [ ! -x "$CURDIR/demo/demo" ]; then
-	BAIL_OUT "No UST nevents binary detected."
-fi
-
 # MUST set TESTDIR before calling those functions
 
 run_demo_app()
@@ -616,6 +612,14 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
+if [ -x "$CURDIR/demo/demo" ]; then
+	foundbin=1
+else
+	foundbin=0
+fi
+
+skip $foundbin "No UST nevents binary detected. Skipping all tests." $NUM_TESTS && exit 0
+
 TESTS=(
 	"test_enable_wildcard_filter"
 	"test_enable_wildcard_filter_2"
diff --git a/tests/regression/ust/ust-dl/test_ust-dl b/tests/regression/ust/ust-dl/test_ust-dl
index 7b835dc..1f2934d 100755
--- a/tests/regression/ust/ust-dl/test_ust-dl
+++ b/tests/regression/ust/ust-dl/test_ust-dl
@@ -21,7 +21,8 @@ TESTDIR=${CURDIR}/../../..
 source $TESTDIR/utils/utils.sh
 
 if [ ! -x "$CURDIR/.libs/libfoo.so" ]; then
-	BAIL_OUT "No shared object generated"
+	diag "No shared object generated. Skipping all tests."
+	exit 0
 fi
 
 start_lttng_sessiond_notap
-- 
2.1.4



More information about the lttng-dev mailing list