Repository navigation
Testing
Everything is measured; nothing is promised. ctest --test-dir build --output-on-failure runs all of it.
One test program per subsystem under tests/ (test_layout, test_flex, test_floats, test_forms, test_style_resolver, test_css_parser, test_http, test_connections, test_cache, test_cookies, test_png, test_jpeg, test_gif, test_truetype, test_rasterizer, test_font_manager, and the rest), written with a small CHECK/CHECK_EQ harness. Network tests serve loopback HTTP from a thread and never touch the network. Codec tests build their inputs by hand — the JPEG test carries its own baseline and progressive encoders — and the PNG test re-decodes the encoder's output through an independent inflate.
| Suite | Score | How it is held |
|---|---|---|
| html5lib tokenizer | 7032 / 7032 | A baseline that only ratchets upward |
| html5lib tree construction | 1784 / 1784 | The same |
WPT urltestdata
|
893 / 893 | The same |
| WPT CSS reference tests | see Measurements |
tests/wpt/passing.txt names every passing test; a listed test that fails is a regression and fails CI |
tests/pages/*.html render to PNGs compared byte for byte against tests/goldens/*.png, on Linux, Windows and macOS, with gcc and with clang. They use the built-in face only, so a golden is one file for every platform. Re-bless with build/tests/reftest tests/pages tests/goldens --update after reading the new picture.
tests/shell/*.script drive the headless shell (see Scripting the shell); their chrome screenshots are goldens too, compared the same way. live.script needs the network and is run by hand.
bash tools/wpt-fetch.sh # a shallow, sparse checkout at tests/wpt/REVISION
build/tests/wpt_reftest wpt tests/wpt/directories.txt tests/wpt/passing.txt --revision tests/wpt/REVISION
The runner reads the suite's own manifest rules (reference names, -manual/-visual/-crash/-print flags), serves the pages as if from http://web-platform.test:8000/ so shared references and the Ahem font resolve with no network, follows <link rel="match"> and <link rel="mismatch"> chains the way wptrunner does, honors the fuzzy-meta allowances, and renders everything at 800×600 with the built-in face plus the page's own fonts. The whole suite — over 13,000 tests, 20,000 renders — takes about 25 seconds.
| Flag | Does |
|---|---|
--only <substring> |
Run the matching tests only (the baseline is not enforced) |
--dump <dir> |
Write the test and reference PNGs of every failure — the instrument |
--print N |
Print up to N failures |
--update |
Re-bless the baseline |
--json <file>, --html <file>
|
Write the per-directory table (docs/wpt.json, docs/wpt.html) |
SASHFOLD_WPT_TRACE=1 |
Print each render as it starts, to find a hang |
A pixel comparison between two renders of the same engine passes when both are equally wrong, so passes are spot-checked with --dump too, and every test that flips is explained before the baseline moves.
libFuzzer harnesses under fuzz/ for the HTML tokenizer and tree builder, the CSS tokenizer and parser, the URL parser, inflate, the HTTP response parser, and the PNG, GIF, JPEG and TrueType readers, with seed corpora. CI runs them as a smoke pass on every push; the sanitizer lane runs the whole test suite under AddressSanitizer and UndefinedBehaviorSanitizer.
tools/pledge-check.sh (the binary's imports against the per-OS allowlist) and tools/egress-check.sh (network primitives behind the one choke point) run in CI and in bash tools/buildall.sh. See The Pledge.
-
--dump-layouton--renderprints the fragment tree;--reportwrites a JSON account of a load;--benchtimes the phases. See Running Sashfold. -
--dump-domprints the parsed tree;--font-info,--font-listand--font-samplershow what the font code sees.
Getting started
What works today
Measured
Design decisions
Testing and tools