aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-09 19:58:27 -0500
committerCraig Jennings <c@cjennings.net>2026-07-09 19:58:27 -0500
commite71c5751d133fc4a0ece61a577ca116255d79a59 (patch)
treecf8ab3ce2152f039915c9165bffac7533c18ea95 /tests
parente15b780739bb260940ed7d6023056c391b6f7400 (diff)
downloadchime-e71c5751d133fc4a0ece61a577ca116255d79a59.tar.gz
chime-e71c5751d133fc4a0ece61a577ca116255d79a59.zip
fix(tests): report skipped integration tests instead of passing them
Every integration test is tagged :slow, so the default run selected none of them and then printed "All integration tests passed" over four "Ran 0 tests" lines. The target now sums the tests actually run. Zero means it says skipped and names make test-all; a real run reports its count. A failing file still exits non-zero. This is the third false-green in this Makefile. The other two read $? after a pipeline (7e03862).
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 6425304..dc12732 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -154,17 +154,22 @@ test-unit: check-deps
# Run only integration tests (excluding :slow)
test-integration: check-deps
@printf "$(YELLOW)Running integration tests ($(words $(INTEGRATION_TESTS)) files, excluding :slow)...$(NC)\n"
- @failed=0; \
+ @failed=0; ran=0; \
for testfile in $(INTEGRATION_TESTS); do \
echo " Testing $$testfile..."; \
- $(EMACS_BATCH) -l ert -l "$$testfile" \
- --eval "$(ERT_FAST_SELECTOR)" || failed=$$((failed + 1)); \
+ out=$$($(EMACS_BATCH) -l ert -l "$$testfile" \
+ --eval "$(ERT_FAST_SELECTOR)" 2>&1) || failed=$$((failed + 1)); \
+ printf '%s\n' "$$out"; \
+ n=$$(printf '%s\n' "$$out" | sed -n 's/^Ran \([0-9][0-9]*\) tests.*/\1/p' | tail -1); \
+ ran=$$((ran + $${n:-0})); \
done; \
- if [ $$failed -eq 0 ]; then \
- printf "$(GREEN)[✓] All integration tests passed$(NC)\n"; \
- else \
+ if [ $$failed -gt 0 ]; then \
printf "$(RED)[✗] $$failed integration test file(s) failed$(NC)\n"; \
exit 1; \
+ elif [ $$ran -eq 0 ]; then \
+ printf "$(YELLOW)[i] Integration tests skipped: every one is tagged :slow. Run 'make test-all'.$(NC)\n"; \
+ else \
+ printf "$(GREEN)[✓] All integration tests passed ($$ran tests)$(NC)\n"; \
fi
# Run tests matching a name pattern (ERT selector)