mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
wpt: fix normal output
This commit is contained in:
6
Makefile
6
Makefile
@@ -23,7 +23,7 @@ help:
|
|||||||
|
|
||||||
# $(ZIG) commands
|
# $(ZIG) commands
|
||||||
# ------------
|
# ------------
|
||||||
.PHONY: build build-release run run-release shell test bench download-zig
|
.PHONY: build build-release run run-release shell test bench download-zig wpt
|
||||||
|
|
||||||
zig_version = $(shell grep 'recommended_zig_version = "' "vendor/jsruntime-lib/build.zig" | cut -d'"' -f2)
|
zig_version = $(shell grep 'recommended_zig_version = "' "vendor/jsruntime-lib/build.zig" | cut -d'"' -f2)
|
||||||
kernel = $(shell uname -ms)
|
kernel = $(shell uname -ms)
|
||||||
@@ -80,6 +80,10 @@ wpt:
|
|||||||
@printf "\e[36mBuilding wpt...\e[0m\n"
|
@printf "\e[36mBuilding wpt...\e[0m\n"
|
||||||
@$(ZIG) build wpt -Dengine=v8 -- --safe $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
|
@$(ZIG) build wpt -Dengine=v8 -- --safe $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
|
||||||
|
|
||||||
|
wpt-summary:
|
||||||
|
@printf "\e[36mBuilding wpt...\e[0m\n"
|
||||||
|
@$(ZIG) build wpt -Dengine=v8 -- --safe --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
|
||||||
|
|
||||||
## Test
|
## Test
|
||||||
test:
|
test:
|
||||||
@printf "\e[36mTesting...\e[0m\n"
|
@printf "\e[36mTesting...\e[0m\n"
|
||||||
|
|||||||
@@ -288,6 +288,7 @@ fn runSafe(
|
|||||||
tests = parsed.value;
|
tests = parsed.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// summary display
|
||||||
if (out == .summary) {
|
if (out == .summary) {
|
||||||
defer std.debug.print("\t{s}\n", .{tc});
|
defer std.debug.print("\t{s}\n", .{tc});
|
||||||
if (result == .crash) {
|
if (result == .crash) {
|
||||||
@@ -310,6 +311,7 @@ fn runSafe(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// json display
|
||||||
if (out == .json) {
|
if (out == .json) {
|
||||||
if (result == .crash) {
|
if (result == .crash) {
|
||||||
var cases = [_]Case{.{
|
var cases = [_]Case{.{
|
||||||
@@ -330,7 +332,23 @@ fn runSafe(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
std.debug.print("{s}\n", .{run.stderr});
|
// normal display
|
||||||
|
std.debug.print("{s}\n", .{tc});
|
||||||
|
if (result == .crash) {
|
||||||
|
std.debug.print("Crash\n{s}", .{run.stderr});
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var pass: u32 = 0;
|
||||||
|
var all: u32 = 0;
|
||||||
|
for (tests) |ttc| {
|
||||||
|
for (ttc.cases) |c| {
|
||||||
|
const status = if (c.pass) "Pass" else "Fail";
|
||||||
|
std.debug.print("{s}\t{s}\n", .{ status, c.name });
|
||||||
|
all += 1;
|
||||||
|
if (c.pass) pass += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
std.debug.print("{d}/{d}\n\n", .{ pass, all });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (out == .json) {
|
if (out == .json) {
|
||||||
|
|||||||
Reference in New Issue
Block a user