]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
probably commited changes to tests/libntp/Makefile.am
authorDamir Tomic <viperus@ntp.org>
Tue, 26 May 2015 09:23:18 +0000 (09:23 +0000)
committerDamir Tomic <viperus@ntp.org>
Tue, 26 May 2015 09:23:18 +0000 (09:23 +0000)
bk: 55643b86tbfIuRDBFv8KFvw1o3A7gA

tests/libntp/Makefile.am

index 2f19a89fe731d311d42af0995af64f71b0deddd8..d5712de757d1a817dd5a12ef07315da38b5b8a00 100644 (file)
@@ -2,13 +2,19 @@ NULL =
 BUILT_SOURCES =
 CLEANFILES =
 
-check_PROGRAMS = tests
+run_unity =    cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
+
+check_PROGRAMS = test-libntp tests
 
 LDADD =                                        \
        $(top_builddir)/libntp/libntp.a \
        $(LDADD_LIBNTP)                 \
        $(PTHREAD_LIBS)                 \
        $(LDADD_NTP)                    \
+       $(NULL)
+
+tests_LDADD =                          \
+       $(LDADD)                        \
        $(GTEST_LDFLAGS)                \
        $(GTEST_LIBS)                   \
        $(NULL)
@@ -41,7 +47,7 @@ tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp     \
                humandate.cpp           \
                lfpfunc.cpp             \
                lfptostr.cpp            \
-               modetoa.cpp             \
+               g_modetoa.cpp           \
                msyslog.cpp             \
                netof.cpp               \
                numtoa.cpp              \
@@ -60,28 +66,49 @@ tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp   \
                timevalops.cpp          \
                tstotv.cpp              \
                tvtots.cpp              \
-               uglydate.cpp            \
+               g_uglydate.cpp          \
                vi64ops.cpp             \
                ymd2yd.cpp              \
                $(NULL)
 
-noinst_HEADERS =       lfptest.h       \
-                       libntptest.h    \
-                       sockaddrtest.h  \
-                       timestructs.h   \
-                       $(NULL)
+noinst_HEADERS =       \
+       lfptest.h       \
+       libntptest.h    \
+       sockaddrtest.h  \
+       timestructs.h   \
+       $(NULL)
+
+$(srcdir)/run-test-libntp.c: $(srcdir)/test-libntp.c $(std_unity_list)
+       $(run_unity) test-libntp.c run-test-libntp.c
+
+test_libntp_CFLAGS =                   \
+       -I$(top_srcdir)/sntp/unity      \
+       $(NULL)
+
+test_libntp_LDADD =                            \
+       $(LDADD)                                \
+       $(top_builddir)/sntp/unity/libunity.a   \
+       $(NULL)
+
+test_libntp_SOURCES =                          \
+       modetoa.c                       \
+       uglydate.c                      \
+       test-libntp.c                   \
+       test-libntp.h                   \
+       run-test-libntp.c               \
+       $(NULL)
 
 TESTS =
 
 if !NTP_CROSSCOMPILE
-TESTS += tests
+TESTS += $(check_PROGRAMS)
 endif
 
 ## check-libntp.mf - automake fragment
 ## slightly adapted for deeper directory
 
-BUILT_SOURCES  += check-libntp
-CLEANFILES     += check-libntp
+BUILT_SOURCES  += check-libntp check-libunity
+CLEANFILES     += check-libntp check-libunity
 
 check-libntp: ../../libntp/libntp.a
        @echo stamp > $@
@@ -89,5 +116,11 @@ check-libntp: ../../libntp/libntp.a
 ../../libntp/libntp.a:
        cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
 
+check-libunity: ../../sntp/unity/libunity.a
+       @echo stamp > $@
+
+../../sntp/unity/libunity.a:
+       cd ../../libunity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
+
 include $(top_srcdir)/depsver.mf
 include $(top_srcdir)/includes.mf