]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_signd test changes
authorLokesh Walase <lokeshw24@ntp.org>
Fri, 24 Jul 2015 06:25:00 +0000 (11:55 +0530)
committerLokesh Walase <lokeshw24@ntp.org>
Fri, 24 Jul 2015 06:25:00 +0000 (11:55 +0530)
bk: 55b1da3cXvbFBbBk3ACXzVeqiL_dnA

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

index e7dfeb5fa2bb220d20612806b0f6e30a92d0af35..3fc9068c5cf2250900c9738996fd919b4ba40016 100644 (file)
@@ -7,6 +7,7 @@ run_unity =     cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
 check_PROGRAMS =               \
        test-leapsec            \
        test-rc_cmdlength   \
+       test-ntp_signd      \
        $(NULL)
 
 if GTEST_AVAILABLE
@@ -49,12 +50,14 @@ tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp   \
                g_ntpdtest.cpp          \
                $(top_srcdir)/ntpd/ntp_leapsec.c        \
                $(top_srcdir)/ntpd/rc_cmdlength.c       \
+               $(top_srcdir)/ntpd/ntp_signd.c  \
                g_leapsec.cpp   \
                $(NULL)
 
 BUILT_SOURCES +=                       \
        $(srcdir)/run-leapsec.c         \
        $(srcdir)/run-rc_cmdlength.c            \
+       $(srcdir)/run-ntp_signd.c               \
        $(NULL)
 
 noinst_HEADERS =       g_ntpdtest.h            \
@@ -98,6 +101,24 @@ test_rc_cmdlength_SOURCES =                 \
 $(srcdir)/run-rc_cmdlength.c: $(srcdir)/rc_cmdlength.c $(std_unity_list)
        $(run_unity) rc_cmdlength.c run-rc_cmdlength.c
 
+###
+test_ntp_signd_CFLAGS =                        \
+       -I$(top_srcdir)/sntp/unity      \
+       $(NULL)
+
+test_ntp_signd_LDADD =                 \
+       $(unity_tests_LDADD)            \
+       $(NULL)
+
+test_ntp_signd_SOURCES =                       \
+       ntp_signd.c                     \
+       run-ntp_signd.c                 \
+       $(srcdir)/../libntp/test-libntp.c               \
+       $(NULL)
+
+$(srcdir)/run-ntp_signd.c: $(srcdir)/ntp_signd.c $(std_unity_list)
+       $(run_unity) ntp_signd.c run-ntp_signd.c
+
 
 TESTS =
 
diff --git a/tests/ntpd/run-ntp_signd.c b/tests/ntpd/run-ntp_signd.c
new file mode 100644 (file)
index 0000000..e840000
--- /dev/null
@@ -0,0 +1,52 @@
+/* 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>
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+void resetTest(void);
+extern void test_ux_socket_connect(void);
+
+
+//=======Test Reset Option=====
+void resetTest()
+{
+  tearDown();
+  setUp();
+}
+
+char *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+  progname = argv[0];
+  Unity.TestFile = "ntp_signd.c";
+  UnityBegin("ntp_signd.c");
+  RUN_TEST(test_ux_socket_connect, 13);
+
+  return (UnityEnd());
+}