mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-06 16:09:30 +00:00
Tests/LibWeb: Add a flag to update expectation metadata in WPT runner
Adds `--update-expectations-metadata` that allows to automatically rebuild metadata.txt file with test expectations.
This commit is contained in:
parent
67de71d302
commit
c48f60a98d
|
@ -7,6 +7,12 @@ then
|
|||
echo "SERENITY_SOURCE_DIR is not set. Exiting."
|
||||
fi
|
||||
|
||||
if [[ "$1" == "--update-expectations-metadata" ]]; then
|
||||
update_expectations_metadata=true
|
||||
else
|
||||
update_expectations_metadata=false
|
||||
fi
|
||||
|
||||
# NOTE: WPT runner assumes Ladybird, WebContent and WebDriver are available in $PATH.
|
||||
export PATH="${SERENITY_SOURCE_DIR}/Build/lagom/bin:${SERENITY_SOURCE_DIR}/Meta/Lagom/Build/bin:${PATH}"
|
||||
|
||||
|
@ -31,5 +37,14 @@ git clone --depth 10000 https://github.com/web-platform-tests/wpt.git
|
|||
# Extract metadata.txt into directory with expectation files expected by WPT runner
|
||||
./concat-extract-metadata.py --extract metadata.txt metadata
|
||||
|
||||
# Generate name for file with wpt run log
|
||||
wpt_run_log_filename="$(mktemp).txt"
|
||||
|
||||
# Run tests.
|
||||
./wpt/wpt run ladybird --no-fail-on-unexpected --no-fail-on-unexpected-pass --skip-timeout --include-manifest include.ini --metadata ./metadata --manifest ./MANIFEST.json --log-raw "${wpt_run_log_filename}"
|
||||
|
||||
# Update expectations metadata files if requested
|
||||
if [[ $update_expectations_metadata == true ]]; then
|
||||
./wpt/wpt update-expectations --product ladybird --metadata ./metadata --manifest ./MANIFEST.json "${wpt_run_log_filename}"
|
||||
./concat-extract-metadata.py --concat ./metadata > metadata.txt
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue