From e71c5751d133fc4a0ece61a577ca116255d79a59 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 9 Jul 2026 19:58:27 -0500 Subject: 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). --- tests/Makefile | 17 +++++++++++------ 1 file 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) -- cgit v1.2.3