From 0795b7a583acacb9eda912fee1148cdd6963632b Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Sat, 18 Oct 2025 08:14:07 +0800 Subject: [PATCH] Filter out the huge compile command when using `make test` I couldn't figure out how (or if it's possible) to do this with build.zig --- Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b0ae6901..095d20e1 100644 --- a/Makefile +++ b/Makefile @@ -96,9 +96,20 @@ wpt-summary: @printf "\e[36mBuilding wpt...\e[0m\n" @$(ZIG) build wpt -- --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;) -## Test +## Test - `awk` is used to filter out the huge compile command on build test: - @TEST_FILTER='${F}' $(ZIG) build test -freference-trace --summary all + @TEST_FILTER='${F}' $(ZIG) build test -freference-trace --summary all 2>&1 | awk '\ + /^error: the following command failed/ {\ + print "error: compilation command failed (command output suppressed for brevity)";\ + while (getline > 0) {\ + if (/^error:/ || /^Build Summary:/ || /^build\.zig:/) {\ + print;\ + break;\ + }\ + }\ + next;\ + }\ + { print; }' ## Run demo/runner end to end tests end2end: