From: Harlan Stenn Date: Thu, 18 Jun 2015 07:49:21 +0000 (+0000) Subject: Unity cleanup X-Git-Tag: NTP_4_3_43~2^2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5de1dc554d9a24e725ec7ee8335682161a6647d;p=thirdparty%2Fntp.git Unity cleanup bk: 55827801WgyNj9SD2-EElz3OTdgf-Q --- diff --git a/sntp/tests/Makefile.am b/sntp/tests/Makefile.am index cb8d48de9..052f50e24 100644 --- a/sntp/tests/Makefile.am +++ b/sntp/tests/Makefile.am @@ -1,27 +1,29 @@ -NULL = +NUL = BUILT_SOURCES = CLEANFILES = +EXTRA_PROGRAMS = run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb +EXTRA_PROGRAMS += test-networking +EXTRA_PROGRAMS += test-keyFile + check_PROGRAMS = \ - test-networking \ - test-kodDatabase + test-kodDatabase \ $(NULL) -# test-keyFile if GTEST_AVAILABLE check_PROGRAMS += tests else -EXTRA_PROGRAMS = tests +EXTRA_PROGRAMS += tests endif #if BUILD_SNTP #check_PROGRAMS += tests #endif -base_SOURCES = \ - $(srcdir)/../tests_main.cpp \ +base_SOURCES = \ + tests_main.cpp \ $(NULL) tests_SOURCES = \ @@ -101,18 +103,18 @@ AM_CPPFLAGS += $(CPPFLAGS_NTP) AM_LDFLAGS = $(LDFLAGS_NTP) -BUILT_SOURCES += \ - $(srcdir)/networking.c run-networking.c \ - $(srcdir)/kodDatabase.c run-kodDatabase.c \ - $(srcdir)/run-keyFile.c \ +BUILT_SOURCES += \ + $(srcdir)/run-networking.c \ + $(srcdir)/run-kodDatabase.c \ + $(srcdir)/run-keyFile.c \ $(NULL) -test_networking_CFLAGS = \ - -I$(top_srcdir)/unity \ +test_networking_CFLAGS = \ + -I$(top_srcdir)/unity \ $(NULL) -test_networking_LDADD = \ - $(unity_tests_LDADD) \ +test_networking_LDADD = \ + $(unity_tests_LDADD) \ $(NULL) test_kodDatabase_CFLAGS = \ @@ -145,7 +147,7 @@ test_kodDatabase_SOURCES = \ test_keyFile_SOURCES = \ keyFile.c \ - run-keyFile.c \ + run-keyFile.c \ $(NULL) $(srcdir)/run-networking.c: $(srcdir)/networking.c $(std_unity_list) diff --git a/sntp/tests/run-test-keyFile.c b/sntp/tests/run-test-keyFile.c deleted file mode 100644 index a87c22984..000000000 --- a/sntp/tests/run-test-keyFile.c +++ /dev/null @@ -1,49 +0,0 @@ -/* 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 -#include - -//=======External Functions This Runner Calls===== -extern void setUp(void); -extern void tearDown(void); - - -//=======Test Reset Option===== -void resetTest() -{ - tearDown(); - setUp(); -} - -char *progname; - - -//=======MAIN===== -int main(int argc, char *argv[]) -{ - progname = argv[0]; - Unity.TestFile = "keyFile.c"; - UnityBegin("keyFile.c"); - - return (UnityEnd()); -} diff --git a/sntp/tests/run-test-kodDatabase.c b/sntp/tests/run-test-kodDatabase.c deleted file mode 100644 index 7fc96783e..000000000 --- a/sntp/tests/run-test-kodDatabase.c +++ /dev/null @@ -1,59 +0,0 @@ -/* 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 -#include - -//=======External Functions This Runner Calls===== -extern void setUp(void); -extern void tearDown(void); -extern void test_SingleEntryHandling(); -extern void test_MultipleEntryHandling(); -extern void test_NoMatchInSearch(); -extern void test_AddDuplicate(); -extern void test_DeleteEntry(); - - -//=======Test Reset Option===== -void resetTest() -{ - tearDown(); - setUp(); -} - -char *progname; - - -//=======MAIN===== -int main(int argc, char *argv[]) -{ - progname = argv[0]; - Unity.TestFile = "kodDatabase.c"; - UnityBegin("kodDatabase.c"); - RUN_TEST(test_SingleEntryHandling, 22); - RUN_TEST(test_MultipleEntryHandling, 35); - RUN_TEST(test_NoMatchInSearch, 66); - RUN_TEST(test_AddDuplicate, 79); - RUN_TEST(test_DeleteEntry, 104); - - return (UnityEnd()); -} diff --git a/sntp/tests/run-test-networking.c b/sntp/tests/run-test-networking.c deleted file mode 100644 index d5e822c71..000000000 --- a/sntp/tests/run-test-networking.c +++ /dev/null @@ -1,49 +0,0 @@ -/* 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 -#include - -//=======External Functions This Runner Calls===== -extern void setUp(void); -extern void tearDown(void); - - -//=======Test Reset Option===== -void resetTest() -{ - tearDown(); - setUp(); -} - -char *progname; - - -//=======MAIN===== -int main(int argc, char *argv[]) -{ - progname = argv[0]; - Unity.TestFile = "networking.c"; - UnityBegin("networking.c"); - - return (UnityEnd()); -}