Fix mistakes in cptest asserts
[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 run-tests
7
8 build-tests: prepare-incdir tests proctests loadtests
9         $(MAKE) -C cptests build-tests
10
11 run-tests: tests proctests loadtests
12         ./tests
13         ./proctests
14         ./loadtests
15         $(MAKE) -C cptests run-tests
16
17 # Create an "includes" directory populated with a combination of real and mock headers:
18 prepare-incdir:
19         mkdir -p includes
20         rm -rf includes/*.h
21         cd includes; ln -f ../../includes/*.h .
22         cd includes; ln -f ../test-includes/*.h .
23
24 tests: $(parent_objs) tests.o test-dinit.o test-bpsys.o test-run-child-proc.o
25         $(CXX) $(SANITIZEOPTS) -o tests $(parent_objs) tests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(LDFLAGS)
26
27 proctests: $(parent_objs) proctests.o test-dinit.o test-bpsys.o test-run-child-proc.o
28         $(CXX) $(SANITIZEOPTS) -o proctests $(parent_objs) proctests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(LDFLAGS)
29         
30 loadtests: $(parent_objs) loadtests.o test-dinit.o test-bpsys.o test-run-child-proc.o
31         $(CXX) $(SANITIZEOPTS) -o loadtests $(parent_objs) loadtests.o test-dinit.o test-bpsys.o test-run-child-proc.o $(LDFLAGS)
32
33 $(objects): %.o: %.cc
34         $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -MMD -MP -Iincludes -I../dasynq -c $< -o $@
35
36 $(parent_objs): %.o: ../%.cc
37         $(CXX) $(CXXOPTS) $(SANITIZEOPTS) -MMD -MP -Iincludes -I../dasynq -c $< -o $@
38
39 clean:
40         $(MAKE) -C cptests clean
41         rm -f *.o *.d tests proctests loadtests
42
43 -include $(objects:.o=.d)
44 -include $(parent_objs:.o=.d)