From 687ef7fece04fb5dffa90b5d784fb1e34066c85a Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 26 Oct 2026 23:08:23 +0100 Subject: Add integration test and its runner --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a884c2c..d5c72cc 100644 --- a/Makefile +++ b/Makefile @@ -134,10 +134,25 @@ $(TESTBIN): $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS) check: $(TESTBIN) $(BINARY) ./$(TESTBIN) -.PHONY: all check clean install +# 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 +# memory errors and the harness turns those into failures. +PYTHON?=python3 +FEATURES_integration=$(FEATURES) -DWANT_IP_FROM_QUERY_STRING +CFLAGS_integration=$(CFLAGS) $(OPTS_debug) $(FEATURES_integration) -fsanitize=address,undefined -fno-omit-frame-pointer +LDFLAGS_integration=$(LDFLAGS) -fsanitize=address,undefined + +opentracker.integration: $(SOURCES) $(HEADERS) + $(CC) -o $@ $(CFLAGS_integration) $(SOURCES) $(LDFLAGS_integration) -lz + +check-integration: opentracker.integration + OPENTRACKER=./opentracker.integration $(PYTHON) -m unittest discover -s tests/integration + +.PHONY: all check check-integration clean install clean: - rm -rf opentracker opentracker.debug proxy proxy.debug $(TESTBIN) *.o *~ + rm -rf opentracker opentracker.debug opentracker.integration proxy proxy.debug $(TESTBIN) *.o *~ install: install -m 755 opentracker $(DESTDIR)$(BINDIR) -- cgit v1.3