]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
run-ntp_util.c:
authorDamir Tomic <viperus@ntp.org>
Mon, 10 Aug 2015 11:15:13 +0000 (13:15 +0200)
committerDamir Tomic <viperus@ntp.org>
Mon, 10 Aug 2015 11:15:13 +0000 (13:15 +0200)
  new file, I guess?
Makefile.am:
  changes to harlan's makefile after merge
run-ntp_prio_q.c:
  hopefully, fixes stuff. Why is this here? Did harlan pull something from tfendrich?

bk: 55c887c1KL3K6hxDiUOhxFUCe_KwuQ

tests/ntpd/Makefile.am
tests/ntpd/run-ntp_prio_q.c
tests/ntpd/run-ntp_util.c [new file with mode: 0644]

index 2ae51c7f3e5c3babda8d092da976a04b186c0dab..1618bcd3310f9a065cc857e04670861442199bd8 100644 (file)
@@ -9,17 +9,17 @@ std_unity_list =                                              \
 run_unity =    cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
 
 check_PROGRAMS =               \
+       test-ntp_signd          \
        test-leapsec            \
        test-rc_cmdlength       \
-       $(NULL)
-
-EXTRA_PROGRAMS =               \
        test-ntp_restrict       \
        test-ntp_scanner        \
-       test-ntp_signd          \
        test-ntp_prio_q         \
        $(NULL)
 
+EXTRA_PROGRAMS =               \
+       $(NULL)
+
 LDADD =                                        \
        $(top_builddir)/ntpd/libntpd.a  \
        $(top_builddir)/libntp/libntp.a \
@@ -51,7 +51,7 @@ BUILT_SOURCES +=                      \
        $(srcdir)/run-ntp_prio_q.c      \
        $(srcdir)/run-ntp_restrict.c    \
        $(srcdir)/run-rc_cmdlength.c    \
-       $(srcdir)/run-ntp_signd.c       \
+       $(srcdir)/run-t-ntp_signd.c     \
        $(NULL)
 
 #noinst_HEADERS =                              \
@@ -143,19 +143,19 @@ test_ntp_signd_CFLAGS =                   \
 
 test_ntp_signd_LDADD =                 \
        $(unity_tests_LDADD)            \
-       $(top_builddir)/ntpd/libntpd.a  \
-       $(top_builddir)/ntpd/ntp_signd.o        \
-       $(unity_tests_LDADD)            \
+       $(top_builddir)/ntpd/ntp_config.o       \
+       $(top_builddir)/ntpd/ntp_io.o   \
        $(NULL)
 
 test_ntp_signd_SOURCES =               \
-       ntp_signd.c                     \
-       run-ntp_signd.c                 \
+       t-ntp_signd.c                   \
+       run-t-ntp_signd.c                       \
        $(srcdir)/../libntp/test-libntp.c       \
+       $(srcdir)/../../ntpd/ntp_signd.c        \
        $(NULL)
 
-$(srcdir)/run-ntp_signd.c: $(srcdir)/ntp_signd.c $(std_unity_list)
-       $(run_unity) ntp_signd.c run-ntp_signd.c
+$(srcdir)/run-ntp_signd.c: $(srcdir)/t-ntp_signd.c $(std_unity_list)
+       $(run_unity) t-ntp_signd.c run-t-ntp_signd.c
 
 ###
 test_ntp_scanner_CFLAGS =              \
index 35af443de58e2dceb6c2d947f3949f89f3cf5e0c..870a9b33bfbdfd5dd16e12f3063a2aaf8a5f0301 100644 (file)
@@ -49,7 +49,7 @@ void resetTest(void)
   setUp();
 }
 
-char const *progname;
+char *progname;
 
 
 //=======MAIN=====
diff --git a/tests/ntpd/run-ntp_util.c b/tests/ntpd/run-ntp_util.c
new file mode 100644 (file)
index 0000000..84166f3
--- /dev/null
@@ -0,0 +1,60 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+  Unity.CurrentTestName = #TestFunc; \
+  Unity.CurrentTestLineNumber = TestLineNum; \
+  Unity.NumberOfTests++; \
+  if (TEST_PROTECT()) \
+  { \
+      setUp(); \
+      TestFunc(); \
+  } \
+  if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+  { \
+    tearDown(); \
+  } \
+  UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "test-libntp.h"
+#include <time.h>
+#include <string.h>
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void test_mprintf_clock_stats(void);
+extern void test_fstostr(void);
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+  tearDown();
+  setUp();
+}
+
+char *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+  progname = argv[0];
+  UnityBegin("ntp_util.c");
+  RUN_TEST(test_mprintf_clock_stats, 13);
+  RUN_TEST(test_fstostr, 27);
+
+  return (UnityEnd());
+}