From 8c482cb2f7019c2491f3bf4f25c4fb5d395ad5da Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 27 Oct 2026 00:28:35 +0100 Subject: add more checkers to the sanitizer and integration check runs --- Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Makefile') 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) check: $(TESTBIN) $(BINARY) ./$(TESTBIN) +# The same unit tests under the sanitizers. Use clang over $(CC) because the +# two toolchains do not check the same things +# Override CC_sanitize to use another compiler. +CC_sanitize?=clang +CFLAGS_sanitize=$(CFLAGS_test) -fsanitize=address,undefined -fno-omit-frame-pointer +LDFLAGS_sanitize=$(LDFLAGS) -fsanitize=address,undefined + +$(TESTBIN).sanitize: $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS) + $(CC_sanitize) -o $@ $(CFLAGS_sanitize) $(TEST_SOURCES) $(TEST_UNITS) $(LDFLAGS_sanitize) + +check-sanitize: $(TESTBIN).sanitize + ./$(TESTBIN).sanitize + # Black box tests: these drive the real binary over the wire, so they cover # the event loop and the parsers working together, which the unit tests # cannot reach. Built with the sanitizers on, so the tracker reports its own @@ -149,10 +162,10 @@ opentracker.integration: $(SOURCES) $(HEADERS) check-integration: opentracker.integration OPENTRACKER=./opentracker.integration $(PYTHON) -m unittest discover -s tests/integration -.PHONY: all check check-integration clean install +.PHONY: all check check-sanitize check-integration clean install clean: - rm -rf opentracker opentracker.debug opentracker.integration proxy proxy.debug $(TESTBIN) *.o *~ + rm -rf opentracker opentracker.debug opentracker.integration proxy proxy.debug $(TESTBIN) $(TESTBIN).sanitize *.o *~ install: install -m 755 opentracker $(DESTDIR)$(BINDIR) -- cgit v1.3