]> git.localhorst.tv Git - orbi.git/blob - build/test.mk
initial collision tests
[orbi.git] / build / test.mk
1 TEST_DIRS := $(shell cd $(TOP); find tests -type d)
2 TEST_SRCS := $(shell cd $(TOP); find tests -type f -name '*.cpp')
3 TEST_OBJS := $(TEST_SRCS:.cpp=.o)
4
5 ALL_DIRS += $(TEST_DIRS)
6 ALL_EXES += test-all$(binext)
7 ALL_OBJS += $(TEST_OBJS)
8
9 TEST_LIBS = $(strip \
10         $(CPPUNIT_LIBS) \
11         $(SDL_LIBS) \
12         $(SDL_IMG_LIBS) \
13 )
14
15 test-all$(binext): $(BASE_OBJS) $(TEST_OBJS)
16         -@$(MKDIR) "$(@D)"
17         @echo "link: $@"
18         $(VERBOSE) $(CXX) -o "$@" $(LDFLAGS) $^ $(TEST_LIBS)
19
20 run-test-all: test-all$(binext)
21         @echo "test: test-all$(binext)"
22         $(VERBOSE) ./test-all$(binext)
23
24 tests: test-all$(binext)
25 test: run-test-all
26
27 .PHONY: run-test-all