Tests: use stubs for various functions.
authorDavin McCall <davmac@davmac.org>
Thu, 11 Jan 2018 22:17:54 +0000 (22:17 +0000)
committerDavin McCall <davmac@davmac.org>
Thu, 11 Jan 2018 22:17:54 +0000 (22:17 +0000)
src/tests/Makefile
src/tests/test-dinit.cc [new file with mode: 0644]

index 7ebdd548fa79be0e35d033d9c1b7071fd160a7c9..26a9eef08e03b3e174f8cae0dfc4ec2cb9e198aa 100644 (file)
@@ -1,7 +1,7 @@
 -include ../../mconfig
 
-objects = tests.o
-parent_objs = service.o baseproc-service.o proc-service.o control.o dinit-log.o load_service.o dinit.o
+objects = tests.o test-dinit.o
+parent_objs = service.o baseproc-service.o proc-service.o control.o dinit-log.o load_service.o dinit.o
 
 check: build-tests
        ./tests
@@ -9,7 +9,7 @@ check: build-tests
 build-tests: tests
 
 tests: $(objects) $(parent_objs)
-       $(CXX) $(SANITIZEOPTS) -o tests tests.o $(parent_objs) $(EXTRA_LIBS)
+       $(CXX) $(SANITIZEOPTS) -o tests $(objects) $(parent_objs) $(EXTRA_LIBS)
 
 $(objects): %.o: %.cc
        $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -I.. -I../dasynq -c $< -o $@
diff --git a/src/tests/test-dinit.cc b/src/tests/test-dinit.cc
new file mode 100644 (file)
index 0000000..9b6ca7a
--- /dev/null
@@ -0,0 +1,15 @@
+#include "dasynq.h"
+
+using eventloop_t = dasynq::event_loop<dasynq::null_mutex>;
+
+eventloop_t event_loop;
+
+int active_control_conns = 0;
+
+void open_control_socket(bool report_ro_failure) noexcept
+{
+}
+
+void setup_external_log() noexcept
+{
+}