From 8acbe07dff3442a327b08e1398fadfde3ace77c3 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 2 Apr 2012 12:10:05 -0400 Subject: [PATCH] Fix tests when lttng-ust is disabled (close #200) Signed-off-by: David Goulet --- tests/tools/Makefile.am | 7 +++++-- tests/tools/runall.sh | 5 +++++ tests/ust/Makefile.am | 2 ++ tests/ust/high-throughput/run | 2 +- tests/ust/low-throughput/run | 2 +- tests/ust/nevents/run | 2 +- tests/ust/nprocesses/run | 3 ++- 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/tools/Makefile.am b/tests/tools/Makefile.am index d13868025..88e86f71a 100644 --- a/tests/tools/Makefile.am +++ b/tests/tools/Makefile.am @@ -3,12 +3,11 @@ AM_LDFLAGS = -lurcu -lurcu-cds EXTRA_DIST = runall.sh -noinst_PROGRAMS = test_sessions test_kernel_data_trace test_ust_data_trace +noinst_PROGRAMS = test_sessions test_kernel_data_trace UTILS=utils.h SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.c KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.c -UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.c COMMON=$(top_builddir)/src/common/libcommon.la HASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la @@ -19,6 +18,10 @@ test_sessions_LDADD = $(COMMON) $(HASHTABLE) # Kernel trace data unit tests test_kernel_data_trace_SOURCES = test_kernel_data_trace.c $(UTILS) $(KERN_DATA_TRACE) +if HAVE_LIBLTTNG_UST_CTL +noinst_PROGRAMS += test_ust_data_trace +UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.c # UST trace data unit tests test_ust_data_trace_SOURCES = test_ust_data_trace.c $(UTILS) $(UST_DATA_TRACE) test_ust_data_trace_LDADD = $(COMMON) $(HASHTABLE) +endif diff --git a/tests/tools/runall.sh b/tests/tools/runall.sh index 5fdbda62b..96c217cf5 100755 --- a/tests/tools/runall.sh +++ b/tests/tools/runall.sh @@ -9,6 +9,11 @@ function start_tests () { for bin in ${tests[@]}; do + if [ ! -e $bin ]; then + echo -e "$bin not found, passing" + continue + fi + ./$bin # Test must return 0 to pass. if [ $? -ne 0 ]; then diff --git a/tests/ust/Makefile.am b/tests/ust/Makefile.am index 300ebf15e..79f67cc06 100644 --- a/tests/ust/Makefile.am +++ b/tests/ust/Makefile.am @@ -1,3 +1,4 @@ +if HAVE_LIBLTTNG_UST_CTL SUBDIRS = nevents nprocesses high-throughput AM_CFLAGS = -g -Wall -I../ @@ -14,3 +15,4 @@ LIBLTTNG=$(top_srcdir)/src/lib/lttng-ctl/lttng-ctl.c \ ust_global_all_events_basic_SOURCES = ust_global_all_events_basic.c $(UTILS) $(LIBLTTNG) ust_global_event_basic_SOURCES = ust_global_event_basic.c $(UTILS) $(LIBLTTNG) +endif diff --git a/tests/ust/high-throughput/run b/tests/ust/high-throughput/run index bc30c8399..a97d27566 100755 --- a/tests/ust/high-throughput/run +++ b/tests/ust/high-throughput/run @@ -28,7 +28,7 @@ echo -e "\n-------------------------------------------" echo -e "UST tracer - Testing high events throughput" echo -e "-------------------------------------------" -if [ ! -e "$CURDIR/$BIN_NAME" ]; then +if [ ! -x "$CURDIR/$BIN_NAME" ]; then echo -e "No UST nevents binary detected. Passing." exit 0 fi diff --git a/tests/ust/low-throughput/run b/tests/ust/low-throughput/run index 8beaf60a5..3f2d1b72c 100755 --- a/tests/ust/low-throughput/run +++ b/tests/ust/low-throughput/run @@ -27,7 +27,7 @@ echo -e "\n-------------------------------------------" echo -e "UST tracer - Testing low events throughput" echo -e "-------------------------------------------" -if [ ! -e "$CURDIR/$BIN_NAME" ]; then +if [ ! -x "$CURDIR/$BIN_NAME" ]; then echo -e "No UST nevents binary detected. Passing." exit 0 fi diff --git a/tests/ust/nevents/run b/tests/ust/nevents/run index 946e8b204..5f3745074 100755 --- a/tests/ust/nevents/run +++ b/tests/ust/nevents/run @@ -25,7 +25,7 @@ echo -e "\n-----------------------------------" echo -e "UST tracer - Generate $NR_ITER events" echo -e "-------------------------------------" -if [ ! -e "$CURDIR/gen-nevents" ]; then +if [ ! -x "$CURDIR/gen-nevents" ]; then echo -e "No UST nevents binary detected. Passing." exit 0 fi diff --git a/tests/ust/nprocesses/run b/tests/ust/nprocesses/run index d2f6d555f..7513fe138 100755 --- a/tests/ust/nprocesses/run +++ b/tests/ust/nprocesses/run @@ -18,6 +18,7 @@ CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../.. NR_ITER=100 +TEST_BIN_NAME="gen-events-time" source $TESTDIR/utils.sh @@ -25,7 +26,7 @@ echo -e "\n-------------------------------------" echo -e "UST tracer - Generate $NR_ITER process" echo -e "---------------------------------------" -if [ ! -e "$CURDIR/$TEST_BIN_NAME" ]; then +if [ ! -x "$CURDIR/$TEST_BIN_NAME" ]; then echo -e "No UST $TEST_BIN_NAME binary detected. Passing." exit 0 fi -- 2.34.1