Add service load test.
[oweals/dinit.git] / src / tests / Makefile
1 -include ../../mconfig
2
3 objects = tests.o test-dinit.o proctests.o loadtests.o test-run-child-proc.o test-bpsys.o
4 parent_objs = service.o proc-service.o dinit-log.o load-service.o baseproc-service.o
5
6 check: build-tests
7         ./tests
8         ./proctests
9         ./loadtests
10
11 build-tests: tests proctests loadtests
12
13 # Create an "includes" directory populated with a combination of real and mock headers:
14 prepare-incdir:
15         mkdir -p includes
16         rm -rf includes/*.h
17         cd includes; ln -sf ../../includes/*.h .
18         cd includes; ln -sf ../test-includes/*.h .
19
20 tests: prepare-incdir $(parent_objs) tests.o test-dinit.o test-bpsys.o test-run-child-proc.o
21         $(CXX) $(SANITIZEOPTS) -o tests $(parent_objs) tests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(LDFLAGS)
22
23 proctests: prepare-incdir $(parent_objs) proctests.o test-dinit.o test-bpsys.o test-run-child-proc.o
24         $(CXX) $(SANITIZEOPTS) -o proctests $(parent_objs) proctests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(LDFLAGS)
25         
26 loadtests: prepare-incdir $(parent_objs) loadtests.o test-dinit.o test-bpsys.o test-run-child-proc.o
27         $(CXX) $(SANITIZEOPTS) -o loadtests $(parent_objs) loadtests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(LDFLAGS)
28
29 $(objects): %.o: %.cc
30         $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -MMD -MP -Iincludes -I../dasynq -c $< -o $@
31
32 $(parent_objs): %.o: ../%.cc
33         $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -MMD -MP -Iincludes -I../dasynq -c $< -o $@
34
35 clean:
36         rm -f *.o *.d
37
38 -include $(objects:.o=.d)
39 -include $(parent_objs:.o=.d)