Unit tests: don't rebuild units under test
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 8 Apr 2013 15:20:04 +0000 (11:20 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 2 May 2013 15:10:02 +0000 (11:10 -0400)
Only the tests themselves are built in the unit test folder. They reuse
the object files that are already built during the main compilation
pass. This would fix the conflicts between object names.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
tests/unit/Makefile.am

index c9e1bfcf44d2cd99ca0ce4505993f501e7ad45a6..67e7fe4545b72aa59904240bcc84a182fea61ccc 100644 (file)
@@ -25,44 +25,47 @@ test_uri_SOURCES = test_uri.c
 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE)
 
 # Session unit test
-SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.c        \
-        $(top_srcdir)/src/bin/lttng-sessiond/consumer.c \
-        $(top_srcdir)/src/bin/lttng-sessiond/health.c \
-        $(top_srcdir)/src/common/uri.c \
-        $(top_srcdir)/src/common/utils.c \
-        $(top_srcdir)/src/common/error.c
+SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.o        \
+        $(top_srcdir)/src/bin/lttng-sessiond/consumer.o \
+        $(top_srcdir)/src/bin/lttng-sessiond/health.o \
+        $(top_srcdir)/src/common/uri.o \
+        $(top_srcdir)/src/common/utils.o \
+        $(top_srcdir)/src/common/error.o
 
-test_session_SOURCES = test_session.c $(SESSIONS)
+test_session_SOURCES = test_session.c
 test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \
                                         -lrt
+test_session_LDADD += $(SESSIONS)
 
 # UST data structures unit test
 if HAVE_LIBLTTNG_UST_CTL
-UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.c \
-              $(top_srcdir)/src/bin/lttng-sessiond/consumer.c \
-                  $(top_srcdir)/src/bin/lttng-sessiond/buffer-registry.c \
-                  $(top_srcdir)/src/bin/lttng-sessiond/ust-registry.c \
-                  $(top_srcdir)/src/bin/lttng-sessiond/ust-metadata.c \
-                  $(top_srcdir)/src/bin/lttng-sessiond/ust-app.c \
-                  $(top_srcdir)/src/bin/lttng-sessiond/ust-consumer.c \
-                  $(top_srcdir)/src/bin/lttng-sessiond/fd-limit.c \
-                  $(top_srcdir)/src/bin/lttng-sessiond/health.c \
-                  $(top_srcdir)/src/bin/lttng-sessiond/session.c \
-                  $(top_srcdir)/src/common/uri.c \
-                  $(top_srcdir)/src/common/utils.c
+UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.o \
+              $(top_srcdir)/src/bin/lttng-sessiond/consumer.o \
+                  $(top_srcdir)/src/bin/lttng-sessiond/buffer-registry.o \
+                  $(top_srcdir)/src/bin/lttng-sessiond/ust-registry.o \
+                  $(top_srcdir)/src/bin/lttng-sessiond/ust-metadata.o \
+                  $(top_srcdir)/src/bin/lttng-sessiond/ust-app.o \
+                  $(top_srcdir)/src/bin/lttng-sessiond/ust-consumer.o \
+                  $(top_srcdir)/src/bin/lttng-sessiond/fd-limit.o \
+                  $(top_srcdir)/src/bin/lttng-sessiond/health.o \
+                  $(top_srcdir)/src/bin/lttng-sessiond/session.o \
+                  $(top_srcdir)/src/common/uri.o \
+                  $(top_srcdir)/src/common/utils.o
 
-test_ust_data_SOURCES = test_ust_data.c $(UST_DATA_TRACE)
+test_ust_data_SOURCES = test_ust_data.c
 test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \
                                          -lrt -llttng-ust-ctl
+test_ust_data_LDADD += $(UST_DATA_TRACE)
 endif
 
 # Kernel data structures unit test
-KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.c    \
-               $(top_srcdir)/src/bin/lttng-sessiond/consumer.c \
-               $(top_srcdir)/src/bin/lttng-sessiond/health.c \
-               $(top_srcdir)/src/common/uri.c \
-               $(top_srcdir)/src/common/utils.c
+KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.o    \
+               $(top_srcdir)/src/bin/lttng-sessiond/consumer.o \
+               $(top_srcdir)/src/bin/lttng-sessiond/health.o \
+               $(top_srcdir)/src/common/uri.o \
+               $(top_srcdir)/src/common/utils.o
 
-test_kernel_data_SOURCES = test_kernel_data.c $(KERN_DATA_TRACE)
+test_kernel_data_SOURCES = test_kernel_data.c
 test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \
                                                 -lrt
+test_kernel_data_LDADD += $(KERN_DATA_TRACE)
This page took 0.029035 seconds and 5 git commands to generate.