diff options
Diffstat (limited to 'Mk')
| -rw-r--r-- | Mk/tests.mk | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Mk/tests.mk b/Mk/tests.mk index 46f308b..2efdd72 100644 --- a/Mk/tests.mk +++ b/Mk/tests.mk | |||
| @@ -29,7 +29,13 @@ LDFLAGS_integration=$(LINK) -fsanitize=address,undefined | |||
| 29 | CFLAGS_tsan=$(OPTS_debug) $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_integration) -fsanitize=thread -fno-omit-frame-pointer | 29 | CFLAGS_tsan=$(OPTS_debug) $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_integration) -fsanitize=thread -fno-omit-frame-pointer |
| 30 | LDFLAGS_tsan=$(LINK) -fsanitize=thread | 30 | LDFLAGS_tsan=$(LINK) -fsanitize=thread |
| 31 | 31 | ||
| 32 | BINARIES+=$(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. | ||
| 35 | FEATURES_livesync=$(FEATURES_integration) -DWANT_SYNC_LIVE | ||
| 36 | CFLAGS_livesync=$(OPTS_debug) $(CPPFLAGS) $(OT_CFLAGS) $(FEATURES_livesync) -fsanitize=address,undefined -fno-omit-frame-pointer | ||
| 37 | |||
| 38 | BINARIES+=$(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) | |||
| 46 | opentracker.tsan: $(SOURCES) $(HEADERS) $(BUILDDEPS) | 52 | opentracker.tsan: $(SOURCES) $(HEADERS) $(BUILDDEPS) |
| 47 | $(CC) -o $@ $(CFLAGS_tsan) $(SOURCES) $(LDFLAGS_tsan) | 53 | $(CC) -o $@ $(CFLAGS_tsan) $(SOURCES) $(LDFLAGS_tsan) |
| 48 | 54 | ||
| 55 | opentracker.livesync: $(SOURCES) $(HEADERS) $(BUILDDEPS) | ||
| 56 | $(CC) -o $@ $(CFLAGS_livesync) $(SOURCES) $(LDFLAGS_integration) | ||
| 57 | |||
| 49 | check: $(TESTBIN) $(BINARY) | 58 | check: $(TESTBIN) $(BINARY) |
| 50 | ./$(TESTBIN) | 59 | ./$(TESTBIN) |
| 51 | 60 | ||
| @@ -61,12 +70,18 @@ check-integration: opentracker.integration | |||
| 61 | check-tsan: opentracker.tsan | 70 | check-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 | # The whole suite against a build that has live sync, which is also the only | ||
| 74 | # way the live sync tests stop skipping. | ||
| 75 | check-livesync: opentracker.livesync | ||
| 76 | OPENTRACKER=./opentracker.livesync $(PYTHON) -m unittest discover -s tests/integration | ||
| 77 | |||
| 64 | # Cheapest first, so a quick failure comes back quickly. | 78 | # Cheapest first, so a quick failure comes back quickly. |
| 65 | check-all: | 79 | check-all: |
| 66 | $(MAKE) check | 80 | $(MAKE) check |
| 67 | $(MAKE) check-poll | 81 | $(MAKE) check-poll |
| 68 | $(MAKE) check-sanitize | 82 | $(MAKE) check-sanitize |
| 69 | $(MAKE) check-integration | 83 | $(MAKE) check-integration |
| 84 | $(MAKE) check-livesync | ||
| 70 | $(MAKE) check-tsan | 85 | $(MAKE) check-tsan |
| 71 | 86 | ||
| 72 | .PHONY: check check-poll check-sanitize check-integration check-tsan check-all | 87 | .PHONY: check check-poll check-sanitize check-integration check-livesync check-tsan check-all |
