-include ../../mconfig
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
+parent_objs = service.o baseproc-service.o proc-service.o dinit-log.o load_service.o
check: build-tests
./tests
-build-tests: tests
+build-tests: prepare-incdir tests
+
+# Create an "includes" directory populated with a combination of real and mock headers:
+prepare-incdir:
+ mkdir -p includes
+ rm -rf includes/*.h
+ cd includes; ln -sf ../../includes/*.h .
+ cd includes; ln -sf ../test-includes/*.h .
tests: $(objects) $(parent_objs)
$(CXX) $(SANITIZEOPTS) -o tests $(objects) $(parent_objs) $(EXTRA_LIBS)
$(objects): %.o: %.cc
- $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -I../includes -I../dasynq -c $< -o $@
+ $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -Iincludes -I../dasynq -c $< -o $@
$(parent_objs): %.o: ../%.cc
- $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -I../includes -I../dasynq -c $< -o $@
+ $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -Iincludes -I../dasynq -c $< -o $@
clean:
rm -f *.o *.d
$(objects:.o=.d): %.d: %.cc
- $(CXX) $(CXXOPTS) -I../includes -I../dasynq -MM -MG -MF $@ $<
+ $(CXX) $(CXXOPTS) -Iincludes -I../dasynq -MM -MG -MF $@ $<
include $(objects:.o=.d)
--- /dev/null
+// dummy control.h
+
+#include "dinit.h"
+
+class service_set;
+
+class control_conn_t
+{
+ public:
+ control_conn_t(eventloop_t &loop, service_set * services_p, int fd)
+ {
+ // active_control_conns++;
+ }
+};