Refactored tests; make just builds library, make test builds/runs tests
This commit is contained in:
parent
236ec733a1
commit
de8db18db4
12 changed files with 613 additions and 615 deletions
19
src/Makefile
19
src/Makefile
|
|
@ -41,7 +41,11 @@ HAMMER_PARTS := \
|
|||
$(PARSERS:%=parsers/%.o) \
|
||||
$(BACKENDS:%=backends/%.o)
|
||||
|
||||
TESTS := t_benchmark.o
|
||||
TESTS := t_benchmark.o \
|
||||
t_bitreader.o \
|
||||
t_bitwriter.o \
|
||||
t_parser.o \
|
||||
test_suite.o
|
||||
|
||||
OUTPUTS := libhammer.a \
|
||||
test_suite.o \
|
||||
|
|
@ -53,6 +57,8 @@ TOPLEVEL := ../
|
|||
|
||||
include ../common.mk
|
||||
|
||||
$(TESTS): CFLAGS += $(TEST_CFLAGS)
|
||||
$(TESTS): LDFLAGS += $(TEST_LDFLAGS)
|
||||
|
||||
all: libhammer.a
|
||||
|
||||
|
|
@ -61,15 +67,10 @@ libhammer.a: $(HAMMER_PARTS)
|
|||
bitreader.o: test_suite.h
|
||||
hammer.o: hammer.h
|
||||
|
||||
ifneq ($(INCLUDE_TESTS),0)
|
||||
all: test_suite
|
||||
|
||||
benchmark: t_benchmark.o libhammer.a
|
||||
$(call hush, "Linking $@") $(CC) -o $@ $^ $(LDFLAGS)
|
||||
all: libhammer.a
|
||||
|
||||
test: test_suite
|
||||
./test_suite -v
|
||||
|
||||
test_suite: test_suite.o libhammer.a
|
||||
$(call hush, "Linking $@") $(CC) -o $@ $^ $(LDFLAGS)
|
||||
endif
|
||||
test_suite: $(TESTS) libhammer.a
|
||||
$(call hush, "Linking $@") $(CC) -o $@ $^ $(LDFLAGS) $(TEST_LDFLAGS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue