summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ae01373..b172af6 100644
--- a/Makefile
+++ b/Makefile
@@ -134,6 +134,19 @@ $(TESTBIN): $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS)
134check: $(TESTBIN) $(BINARY) 134check: $(TESTBIN) $(BINARY)
135 ./$(TESTBIN) 135 ./$(TESTBIN)
136 136
137# The same unit tests under the sanitizers. Use clang over $(CC) because the
138# two toolchains do not check the same things
139# Override CC_sanitize to use another compiler.
140CC_sanitize?=clang
141CFLAGS_sanitize=$(CFLAGS_test) -fsanitize=address,undefined -fno-omit-frame-pointer
142LDFLAGS_sanitize=$(LDFLAGS) -fsanitize=address,undefined
143
144$(TESTBIN).sanitize: $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS)
145 $(CC_sanitize) -o $@ $(CFLAGS_sanitize) $(TEST_SOURCES) $(TEST_UNITS) $(LDFLAGS_sanitize)
146
147check-sanitize: $(TESTBIN).sanitize
148 ./$(TESTBIN).sanitize
149
137# Black box tests: these drive the real binary over the wire, so they cover 150# Black box tests: these drive the real binary over the wire, so they cover
138# the event loop and the parsers working together, which the unit tests 151# the event loop and the parsers working together, which the unit tests
139# cannot reach. Built with the sanitizers on, so the tracker reports its own 152# cannot reach. Built with the sanitizers on, so the tracker reports its own
@@ -149,10 +162,10 @@ opentracker.integration: $(SOURCES) $(HEADERS)
149check-integration: opentracker.integration 162check-integration: opentracker.integration
150 OPENTRACKER=./opentracker.integration $(PYTHON) -m unittest discover -s tests/integration 163 OPENTRACKER=./opentracker.integration $(PYTHON) -m unittest discover -s tests/integration
151 164
152.PHONY: all check check-integration clean install 165.PHONY: all check check-sanitize check-integration clean install
153 166
154clean: 167clean:
155 rm -rf opentracker opentracker.debug opentracker.integration proxy proxy.debug $(TESTBIN) *.o *~ 168 rm -rf opentracker opentracker.debug opentracker.integration proxy proxy.debug $(TESTBIN) $(TESTBIN).sanitize *.o *~
156 169
157install: 170install:
158 install -m 755 opentracker $(DESTDIR)$(BINDIR) 171 install -m 755 opentracker $(DESTDIR)$(BINDIR)