BUILT_SOURCES =
CLEANFILES =
-run_unity = cd $(srcdir) && ruby /unity/auto/generate_test_runner.rb
+run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
check_PROGRAMS = \
test-networking \
$(NULL)
-#maybe an issue where with if GTEST...
-if BUILD_SNTP
+if GTEST_AVAILABLE
check_PROGRAMS += tests
+else
+EXTRA_PROGRAMS = tests
endif
+#if BUILD_SNTP
+#check_PROGRAMS += tests
+#endif
+
base_SOURCES = \
$(srcdir)/../tests_main.cpp \
$(NULL)
noinst_HEADERS = \
sntptest.h \
+ c_sntptest.h \
fileHandlingTest.h \
$(NULL)
test_networking_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
+ -I$(top_srcdir)/unity \
$(NULL)
test_networking_LDADD = \
$(LDADD) \
- $(top_builddir)/sntp/unity/libunity.a \
+ $(top_builddir)/unity/libunity.a \
$(NULL)
BUILT_SOURCES += \
- $(run_unity) networking.c run-test-networking.c \
+ $(srcdir)/networking.c run-test-networking.c \
$(NULL)
test_networking_SOURCES = \
TESTS =
if !NTP_CROSSCOMPILE
-TESTS += tests-runner
+TESTS += $(check_PROGRAMS)
endif
+#if !NTP_CROSSCOMPILE
+#TESTS += tests-runner
+#endif
## ensure ../libsntp.a is built
## 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 > $@
../../libntp/libntp.a:
cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+check-libunity: ../sntp/unity/libunity.a
+ @echo stamp > $@
+
+../sntp/unity/libunity.a:
+ cd ../unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
+
include $(top_srcdir)/depsver.mf
include $(top_srcdir)/includes.mf
--- /dev/null
+#ifndef SNTPTEST_H
+#define SNTPTEST_H
+
+//#include "tests_main.h"
+
+#include "ntp_stdlib.h"
+#include "sntp-opts.h"
+
+
+sntptest() {
+ optionSaveState(&sntpOptions);
+}
+/*
+~sntptest() {
+ optionRestore(&sntpOptions);
+}
+*/
+void ActivateOption(const char* option, const char* argument) {
+ const int ARGV_SIZE = 4;
+
+ char* opts[ARGV_SIZE];
+
+ opts[0] = estrdup("sntpopts");
+ opts[1] = estrdup(option);
+ opts[2] = estrdup(argument);
+ opts[3] = estrdup("127.0.0.1");
+
+ optionProcess(&sntpOptions, ARGV_SIZE, opts);
+}
+
+
+#endif // SNTPTEST_H
--- /dev/null
+/* 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);
+
+
+//=======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());
+}