mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
Meta: Add the ability to import entire test directories with WPT.sh
This uses the `WPT.sh list-tests` command to find which tests are in each given path.
This commit is contained in:
parent
a4f1838798
commit
cb8a1f6bb6
Notes:
github-actions[bot]
2024-12-11 23:31:27 +00:00
Author: https://github.com/tcl3
Commit: cb8a1f6bb6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2848
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/shlyakpavel
Reviewed-by: https://github.com/sideshowbarker
1 changed files with 14 additions and 2 deletions
16
Meta/WPT.sh
16
Meta/WPT.sh
|
@ -58,7 +58,7 @@ print_help() {
|
||||||
Run the Web Platform Tests.
|
Run the Web Platform Tests.
|
||||||
compare: $NAME compare [OPTIONS...] LOG_FILE [TESTS...]
|
compare: $NAME compare [OPTIONS...] LOG_FILE [TESTS...]
|
||||||
Run the Web Platform Tests comparing the results to the expectations in LOG_FILE.
|
Run the Web Platform Tests comparing the results to the expectations in LOG_FILE.
|
||||||
import: $NAME import [TESTS...]
|
import: $NAME import [PATHS...]
|
||||||
Fetch the given test file(s) from https://wpt.live/ and create an in-tree test and expectation files.
|
Fetch the given test file(s) from https://wpt.live/ and create an in-tree test and expectation files.
|
||||||
list-tests: $NAME list-tests [PATHS..]
|
list-tests: $NAME list-tests [PATHS..]
|
||||||
List the tests in the given PATHS.
|
List the tests in the given PATHS.
|
||||||
|
@ -220,9 +220,21 @@ import_wpt()
|
||||||
item="${item#https://wpt.live/}"
|
item="${item#https://wpt.live/}"
|
||||||
INPUT_PATHS[i]="$item"
|
INPUT_PATHS[i]="$item"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
TESTS=()
|
||||||
|
while IFS= read -r test_file; do
|
||||||
|
TESTS+=("$test_file")
|
||||||
|
done < <(
|
||||||
|
"${ARG0}" list-tests "${INPUT_PATHS[@]}"
|
||||||
|
)
|
||||||
|
if [ "${#TESTS[@]}" -eq 0 ]; then
|
||||||
|
echo "No tests found for the given paths"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
pushd "${LADYBIRD_SOURCE_DIR}" > /dev/null
|
pushd "${LADYBIRD_SOURCE_DIR}" > /dev/null
|
||||||
./Meta/ladybird.sh build headless-browser
|
./Meta/ladybird.sh build headless-browser
|
||||||
for path in "${INPUT_PATHS[@]}"; do
|
for path in "${TESTS[@]}"; do
|
||||||
echo "Importing test from ${path}"
|
echo "Importing test from ${path}"
|
||||||
./Meta/import-wpt-test.py https://wpt.live/"${path}"
|
./Meta/import-wpt-test.py https://wpt.live/"${path}"
|
||||||
"${HEADLESS_BROWSER_BINARY}" --run-tests ./Tests/LibWeb --rebaseline -f "$path"
|
"${HEADLESS_BROWSER_BINARY}" --run-tests ./Tests/LibWeb --rebaseline -f "$path"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue