Skip to content

Commit ca3fa3d

Browse files
authored
Rework WPT runner (#589)
* Rework WPT runner We have no crashing tests, remove safe mode. Allows better re-use of arenas, and if we do introduce a crash, it won't be easy to ignore. Could allow for re-using the environment across tests to further improve performance. Remove console now that we have a working console api. * Update workflows, add summary Remove --safe option from WPT workflows (it's no longer valid) Include a total test/case summary when --summary or --text (default) is used. * remove wpt --safe flag from Makefile * handle tests in the root of the test folder * Fix a couple possible segfaults base on strange usage (WPT stuff) * generate proper JSON * generate proper JSON (for real this time?) * fix tag type check
1 parent 271b2a0 commit ca3fa3d

File tree

8 files changed

+366
-753
lines changed

8 files changed

+366
-753
lines changed

.github/workflows/wpt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
- uses: ./.github/actions/install
5757

58-
- run: zig build wpt -- --safe --summary
58+
- run: zig build wpt -- --summary
5959

6060
# For now WPT tests doesn't pass at all.
6161
# We accept then to continue the job on failure.
@@ -80,7 +80,7 @@ jobs:
8080
- uses: ./.github/actions/install
8181

8282
- name: json output
83-
run: zig build wpt -- --safe --json > wpt.json
83+
run: zig build wpt -- --json > wpt.json
8484

8585
- name: write commit
8686
run: |

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ shell:
8585
## Run WPT tests
8686
wpt:
8787
@printf "\e[36mBuilding wpt...\e[0m\n"
88-
@$(ZIG) build wpt -- --safe $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
88+
@$(ZIG) build wpt -- $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
8989

9090
wpt-summary:
9191
@printf "\e[36mBuilding wpt...\e[0m\n"
92-
@$(ZIG) build wpt -- --safe --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
92+
@$(ZIG) build wpt -- --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
9393

9494
## Test
9595
test:

src/browser/netsurf.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,14 @@ pub fn elementHTMLGetTagType(elem_html: *ElementHTML) !Tag {
16261626
var tag_type: c.dom_html_element_type = undefined;
16271627
const err = elementHTMLVtable(elem_html).dom_html_element_get_tag_type.?(elem_html, &tag_type);
16281628
try DOMErr(err);
1629+
1630+
if (tag_type >= 255) {
1631+
// This is questionable, but std.meta.intToEnum has more overhead
1632+
// Added this because this WPT test started to fail once we
1633+
// introduced an SVGElement:
1634+
// html/dom/documents/dom-tree-accessors/document.title-09.html
1635+
return Tag.undef;
1636+
}
16291637
return @as(Tag, @enumFromInt(tag_type));
16301638
}
16311639

0 commit comments

Comments
 (0)