summaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-11-03 02:40:38 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-11-03 02:40:38 +0100
commit0fcf290ba2db320287163f142a83da0f9fe48b77 (patch)
treef1737d669a0510eff32ea6e714f14804524fcb5c /Mk
parent21f4d0875aad382d021ff37ece09999a61fb4129 (diff)
Add integration tests for live sync
Diffstat (limited to 'Mk')
-rw-r--r--Mk/tests.mk20
1 files changed, 18 insertions, 2 deletions
diff --git a/Mk/tests.mk b/Mk/tests.mk
index 46f308b..a7d4fbc 100644
--- a/Mk/tests.mk
+++ b/Mk/tests.mk
@@ -29,7 +29,13 @@ LDFLAGS_integration=$(LINK) -fsanitize=address,undefined
29CFLAGS_tsan=$(OPTS_debug) $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_integration) -fsanitize=thread -fno-omit-frame-pointer 29CFLAGS_tsan=$(OPTS_debug) $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_integration) -fsanitize=thread -fno-omit-frame-pointer
30LDFLAGS_tsan=$(LINK) -fsanitize=thread 30LDFLAGS_tsan=$(LINK) -fsanitize=thread
31 31
32BINARIES+=$(TESTBIN) $(TESTBIN).poll $(TESTBIN).sanitize opentracker.integration opentracker.tsan 32# Live sync is a compile time feature, so reaching it from a black box test
33# needs a binary of its own. tests/integration/test_livesync.py skips itself
34# against a build without it, which is what -v is for.
35FEATURES_livesync=$(FEATURES_integration) -DWANT_SYNC_LIVE
36CFLAGS_livesync=$(OPTS_debug) $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_livesync) -fsanitize=address,undefined -fno-omit-frame-pointer
37
38BINARIES+=$(TESTBIN) $(TESTBIN).poll $(TESTBIN).sanitize opentracker.integration opentracker.tsan opentracker.livesync
33 39
34$(TESTBIN): $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS) $(BUILDDEPS) 40$(TESTBIN): $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS) $(BUILDDEPS)
35 $(CC) -o $@ $(CFLAGS_test) $(TEST_SOURCES) $(TEST_UNITS) 41 $(CC) -o $@ $(CFLAGS_test) $(TEST_SOURCES) $(TEST_UNITS)
@@ -46,6 +52,9 @@ opentracker.integration: $(SOURCES) $(HEADERS) $(BUILDDEPS)
46opentracker.tsan: $(SOURCES) $(HEADERS) $(BUILDDEPS) 52opentracker.tsan: $(SOURCES) $(HEADERS) $(BUILDDEPS)
47 $(CC) -o $@ $(CFLAGS_tsan) $(SOURCES) $(LDFLAGS_tsan) 53 $(CC) -o $@ $(CFLAGS_tsan) $(SOURCES) $(LDFLAGS_tsan)
48 54
55opentracker.livesync: $(SOURCES) $(HEADERS) $(BUILDDEPS)
56 $(CC) -o $@ $(CFLAGS_livesync) $(SOURCES) $(LDFLAGS_integration)
57
49check: $(TESTBIN) $(BINARY) 58check: $(TESTBIN) $(BINARY)
50 ./$(TESTBIN) 59 ./$(TESTBIN)
51 60
@@ -61,12 +70,19 @@ check-integration: opentracker.integration
61check-tsan: opentracker.tsan 70check-tsan: opentracker.tsan
62 OPENTRACKER=./opentracker.tsan $(PYTHON) -m unittest discover -s tests/integration 71 OPENTRACKER=./opentracker.tsan $(PYTHON) -m unittest discover -s tests/integration
63 72
73# Only the live sync tests: a build with WANT_SYNC_LIVE refuses to start
74# without a live sync address, so it cannot stand in for the plain binary in
75# the rest of the suite.
76check-livesync: opentracker.livesync
77 OPENTRACKER=./opentracker.livesync $(PYTHON) -m unittest discover -s tests/integration -p 'test_livesync.py'
78
64# Cheapest first, so a quick failure comes back quickly. 79# Cheapest first, so a quick failure comes back quickly.
65check-all: 80check-all:
66 $(MAKE) check 81 $(MAKE) check
67 $(MAKE) check-poll 82 $(MAKE) check-poll
68 $(MAKE) check-sanitize 83 $(MAKE) check-sanitize
69 $(MAKE) check-integration 84 $(MAKE) check-integration
85 $(MAKE) check-livesync
70 $(MAKE) check-tsan 86 $(MAKE) check-tsan
71 87
72.PHONY: check check-poll check-sanitize check-integration check-tsan check-all 88.PHONY: check check-poll check-sanitize check-integration check-livesync check-tsan check-all