tests: Convert unit tests to TAP
[urcu.git] / tests / unit / Makefile.am
index 8cc4acbd9e217c3e70486dfb58334a86a45cd1a9..08a3cba6f40c03d92e49b4e13e91101b52ee2e5f 100644 (file)
@@ -1,12 +1,16 @@
 if !LIBC_INCLUDES_PTHREAD
 AM_LDFLAGS=-lpthread
 endif
-AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g
+AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
+
+SCRIPT_LIST = test_loop run.sh unit_tests
 
 noinst_PROGRAMS = test_uatomic \
        test_urcu_multiflavor \
        test_urcu_multiflavor_dynlink
 
+dist_noinst_SCRIPTS = $(SCRIPT_LIST)
+
 noinst_HEADERS = test_urcu_multiflavor.h
 
 URCU_COMMON_LIB=$(top_builddir)/liburcu-common.la
@@ -16,9 +20,10 @@ URCU_MB_LIB=$(top_builddir)/liburcu-mb.la
 URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la
 URCU_BP_LIB=$(top_builddir)/liburcu-bp.la
 URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la
+TAP_LIB=$(top_builddir)/tests/utils/libtap.a
 
 test_uatomic_SOURCES = test_uatomic.c
-test_uatomic_LDADD = $(URCU_COMMON_LIB)
+test_uatomic_LDADD = $(URCU_COMMON_LIB) $(TAP_LIB)
 
 test_urcu_multiflavor_SOURCES = test_urcu_multiflavor.c \
        test_urcu_multiflavor-memb.c \
@@ -27,7 +32,7 @@ test_urcu_multiflavor_SOURCES = test_urcu_multiflavor.c \
        test_urcu_multiflavor-qsbr.c \
        test_urcu_multiflavor-bp.c
 test_urcu_multiflavor_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \
-       $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB)
+       $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB)
 
 test_urcu_multiflavor_dynlink_SOURCES = test_urcu_multiflavor.c \
        test_urcu_multiflavor-memb.c \
@@ -37,9 +42,21 @@ test_urcu_multiflavor_dynlink_SOURCES = test_urcu_multiflavor.c \
        test_urcu_multiflavor-bp.c
 test_urcu_multiflavor_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
 test_urcu_multiflavor_dynlink_LDADD = $(URCU_LIB) $(URCU_MB_LIB) \
-       $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB)
+       $(URCU_SIGNAL_LIB) $(URCU_QSBR_LIB) $(URCU_BP_LIB) $(TAP_LIB)
+
+all-local:
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for script in $(SCRIPT_LIST); do \
+                       cp -f $(srcdir)/$$script $(builddir); \
+               done; \
+       fi
+
+clean-local:
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for script in $(SCRIPT_LIST); do \
+                       rm -f $(builddir)/$$script; \
+               done; \
+       fi
 
 check-am:
-       ./test_uatomic
-       ./test_urcu_multiflavor
-       ./test_urcu_multiflavor_dynlink
+       ./run.sh unit_tests
This page took 0.030966 seconds and 4 git commands to generate.