Skip to content

Commit 0795b7a

Browse files
committed
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
1 parent 29f0e71 commit 0795b7a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,20 @@ wpt-summary:
9696
@printf "\e[36mBuilding wpt...\e[0m\n"
9797
@$(ZIG) build wpt -- --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
9898

99-
## Test
99+
## Test - `awk` is used to filter out the huge compile command on build
100100
test:
101-
@TEST_FILTER='${F}' $(ZIG) build test -freference-trace --summary all
101+
@TEST_FILTER='${F}' $(ZIG) build test -freference-trace --summary all 2>&1 | awk '\
102+
/^error: the following command failed/ {\
103+
print "error: compilation command failed (command output suppressed for brevity)";\
104+
while (getline > 0) {\
105+
if (/^error:/ || /^Build Summary:/ || /^build\.zig:/) {\
106+
print;\
107+
break;\
108+
}\
109+
}\
110+
next;\
111+
}\
112+
{ print; }'
102113

103114
## Run demo/runner end to end tests
104115
end2end:

0 commit comments

Comments
 (0)