Fix: tests: don't build dynamic lib tests if support disabled
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 12 May 2016 20:08:43 +0000 (16:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 14 May 2016 18:57:09 +0000 (14:57 -0400)
Fixes: #977
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/health/Makefile.am
tests/regression/ust/clock-override/Makefile.am
tests/regression/ust/getcpu-override/Makefile.am
tests/regression/ust/linking/Makefile.am
tests/regression/ust/overlap/demo/Makefile.am
tests/regression/ust/ust-dl/Makefile.am
tests/regression/ust/ust-dl/test_ust-dl

index 643dd31d2081b3deaba926d78575d26e3ee5770c..4d835f3dfa4d360fe4b4538de2679197a97af519 100644 (file)
@@ -8,9 +8,17 @@ if LTTNG_TOOLS_BUILD_WITH_LIBC_DL
 LIBS += -lc
 endif
 
+COPYSCRIPTS = test_thread_exit test_thread_stall test_tp_fail \
+       test_health.sh test_thread_ok
+dist_noinst_SCRIPTS = $(COPYSCRIPTS)
+
 if NO_SHARED
 # Do not build this test if shared libraries support was
 # explicitly disabled.
+
+EXTRA_DIST = health_exit.c health_stall.c health_fail.c \
+       health_check.c $(COPYSCRIPTS)
+
 else
 # In order to test the health check feature, the libhealth* libs
 # must be built as .so to be able to LD_PRELOAD them.
@@ -35,23 +43,21 @@ noinst_LTLIBRARIES = libhealthexit.la libhealthstall.la libhealthtpfail.la
 health_check_SOURCES = health_check.c $(UTILS)
 health_check_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
                     $(top_builddir)/src/common/libcommon.la
-endif
 
-dist_noinst_SCRIPTS = test_thread_exit test_thread_stall test_tp_fail \
-               test_health.sh test_thread_ok
-EXTRA_DIST = test_thread_exit test_thread_stall test_tp_fail \
-               test_health.sh test_thread_ok
+EXTRA_DIST = $(COPYSCRIPTS)
+
+endif
 
 all-local:
        @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
-               for script in $(EXTRA_DIST); do \
+               for script in $(COPYSCRIPTS); do \
                        cp -f $(srcdir)/$$script $(builddir); \
                done; \
        fi
 
 clean-local:
        @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
-               for script in $(EXTRA_DIST); do \
+               for script in $(COPYSCRIPTS); do \
                        rm -f $(builddir)/$$script; \
                done; \
        fi
index 95065e0ed1ba6b580395be72521dcd1f3f021c2f..cc4b02c1eba69223f9f2f8839bfc7ea8abfe819a 100644 (file)
@@ -1,3 +1,14 @@
+if NO_SHARED
+# Do not build this test if shared libraries support was
+# explicitly disabled.
+
+CLEANFILES = lttng-ust-clock-override-test.so \
+       lttng-ust-clock-override-test.so.debug
+
+EXTRA_DIST = test_clock_override lttng-ust-clock-override-test.c
+
+else
+
 AM_CPPFLAGS = -I$(srcdir)
 
 # The rpath is necessary because libtool won't build a shared library
@@ -35,3 +46,5 @@ clean-local:
                        rm -f $(builddir)/$$script; \
                done; \
        fi
+
+endif
index f1026ac02e96417b946d6af33d01cacda7974f07..a7bdc86cdd68af5dc562fa96ef9c76458eb16882 100644 (file)
@@ -1,3 +1,15 @@
+if NO_SHARED
+# Do not build this test if shared libraries support was
+# explicitly disabled.
+
+CLEANFILES = lttng-ust-getcpu-override-test.so \
+       lttng-ust-getcpu-override-test.so.debug
+
+EXTRA_DIST = test_getcpu_override run-getcpu-override \
+       lttng-ust-getcpu-override-test.c
+
+else
+
 AM_CPPFLAGS = -I$(srcdir)
 
 # The rpath is necessary because libtool won't build a shared library
@@ -35,3 +47,5 @@ clean-local:
                        rm -f $(builddir)/$$script; \
                done; \
        fi
+
+endif
index 9f7ebecb9e8d8d3dbe1de3ae93d29af653c6d99d..1c80ae8392144f0448ba0c228c3815e509df6d65 100644 (file)
@@ -44,7 +44,16 @@ endif
 
 noinst_PROGRAMS = demo_builtin demo_static
 
-if !NO_SHARED
+COPYSCRIPTS = test_linking test_linking.py demo_preload
+noinst_SCRIPTS = $(COPYSCRIPTS)
+
+if NO_SHARED
+
+EXTRA_DIST = tp.c ust_tests_demo.h tp2.c ust_tests_demo2.h \
+       tp3.c ust_tests_demo3.h demo.c ust_tests_demo.h \
+       $(COPYSCRIPTS)
+
+else
 # Force the shared flag on the noinst libraries since they are
 # only built static by default
 FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \
@@ -79,21 +88,20 @@ if LTTNG_TOOLS_BUILD_WITH_LIBC_DL
 demo_LDADD = -lc
 endif
 
-endif
+EXTRA_DIST = $(COPYSCRIPTS)
 
-noinst_SCRIPTS = test_linking test_linking.py demo_preload
-EXTRA_DIST = test_linking test_linking.py demo_preload
+endif
 
 all-local:
        @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
-               for script in $(EXTRA_DIST); do \
+               for script in $(COPYSCRIPTS); do \
                        cp -f $(srcdir)/$$script $(builddir); \
                done; \
        fi
 
 clean-local:
        @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
-               for script in $(EXTRA_DIST); do \
+               for script in $(COPYSCRIPTS); do \
                        rm -f $(builddir)/$$script; \
                done; \
        fi
index c5e9f92d589334a93cfbc46a07ba4c6ad4248032..15f5600d61f0465d6cf6bf72207711d9e3bf6b41 100644 (file)
@@ -1,8 +1,17 @@
-AM_CFLAGS=-I$(srcdir)
 if NO_SHARED
 # Do not build this test if shared libraries support was
 # explicitly disabled.
+
+CLEANFILES = demo
+
+EXTRA_DIST = demo-trace demo.c ust_tests_demo.h \
+       tp3.c ust_tests_demo3.h tp2.c ust_tests_demo2.h \
+       tp.c ust_tests_demo.h
+
 else
+
+AM_CFLAGS=-I$(srcdir)
+
 # Force the shared flag on the noinst libraries since they are
 # only built static by default
 FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \
@@ -49,4 +58,5 @@ clean-local:
                        rm -f $(builddir)/$$script; \
                done; \
        fi
+
 endif
index c12da16d0ad509031e919034f62a28d09307de7e..bcd700109a42ba7ce987bdd6a10ab151ec3fbf82 100644 (file)
@@ -1,3 +1,14 @@
+if NO_SHARED
+# Do not build this test if shared libraries support was
+# explicitly disabled.
+
+CLEANFILES = libfoo.so libfoo.so.debug prog
+
+EXTRA_DIST = test_ust-dl test_ust-dl.py libfoo.c libfoo.h \
+       prog.c
+
+else
+
 objcopy_verbose = $(objcopy_verbose_@AM_V@)
 objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@)
 objcopy_verbose_0 = @echo OBJCOPY $@;
@@ -13,8 +24,7 @@ libfoo_la_SOURCES = libfoo.c libfoo.h
 libfoo_la_LDFLAGS = -module -shared -avoid-version \
                -rpath $(abs_builddir)
 
-noinst_SCRIPTS = test_ust-dl test_ust-dl.py
-EXTRA_DIST = test_ust-dl test_ust-dl.py
+CLEANFILES = libfoo.so libfoo.so.debug
 
 # Extract debug symbols
 libfoo.so.debug: libfoo.la
@@ -25,6 +35,9 @@ libfoo.so: libfoo.so.debug
        @cp -f .libs/libfoo.so libfoo.so
        $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=libfoo.so.debug libfoo.so
 
+noinst_SCRIPTS = test_ust-dl test_ust-dl.py
+EXTRA_DIST = test_ust-dl test_ust-dl.py
+
 all-local: libfoo.so
        @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
                for script in $(EXTRA_DIST); do \
@@ -39,4 +52,4 @@ clean-local:
                done; \
        fi
 
-CLEANFILES = libfoo.so libfoo.so.debug
+endif
index 9e80bb39cd38a64083df926fc0812d5e3bdcb820..7b835dcbd290c143ba0b1d64a1f8ad91691f60fa 100755 (executable)
@@ -20,6 +20,10 @@ TESTDIR=${CURDIR}/../../..
 
 source $TESTDIR/utils/utils.sh
 
+if [ ! -x "$CURDIR/.libs/libfoo.so" ]; then
+       BAIL_OUT "No shared object generated"
+fi
+
 start_lttng_sessiond_notap
 
 python3 ${CURDIR}/test_ust-dl.py
This page took 0.028592 seconds and 4 git commands to generate.