mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
Meta: Add a list-tests
command to WPT.sh
This outputs a list of all the tests that would be run in the given test directories.
This commit is contained in:
parent
d5cdda0b40
commit
a4f1838798
Notes:
github-actions[bot]
2024-12-11 23:31:33 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/a4f18387989 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 17 additions and 1 deletions
18
Meta/WPT.sh
18
Meta/WPT.sh
|
@ -60,6 +60,8 @@ print_help() {
|
|||
Run the Web Platform Tests comparing the results to the expectations in LOG_FILE.
|
||||
import: $NAME import [TESTS...]
|
||||
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 the tests in the given PATHS.
|
||||
|
||||
Examples:
|
||||
$NAME update
|
||||
|
@ -76,6 +78,8 @@ print_help() {
|
|||
Run the Web Platform Tests in the 'css/CSS2' directory, comparing the results to the expectations in expectations.log; output the results to results.log.
|
||||
$NAME import html/dom/aria-attribute-reflection.html
|
||||
Import the test from https://wpt.live/html/dom/aria-attribute-reflection.html into the Ladybird test suite.
|
||||
$NAME list-tests css/CSS2 dom
|
||||
Show a list of all tests in the 'css/CSS2' and 'dom' directories.
|
||||
EOF
|
||||
}
|
||||
|
||||
|
@ -199,6 +203,15 @@ serve_wpt()
|
|||
popd > /dev/null
|
||||
}
|
||||
|
||||
list_tests_wpt()
|
||||
{
|
||||
ensure_wpt_repository
|
||||
|
||||
pushd "${WPT_SOURCE_DIR}" > /dev/null
|
||||
./wpt run --list-tests ladybird "${TEST_LIST[@]}"
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
import_wpt()
|
||||
{
|
||||
for i in "${!INPUT_PATHS[@]}"; do
|
||||
|
@ -229,7 +242,7 @@ compare_wpt() {
|
|||
rm -rf "${METADATA_DIR}"
|
||||
}
|
||||
|
||||
if [[ "$CMD" =~ ^(update|run|serve|compare|import)$ ]]; then
|
||||
if [[ "$CMD" =~ ^(update|run|serve|compare|import|list-tests)$ ]]; then
|
||||
case "$CMD" in
|
||||
update)
|
||||
update_wpt
|
||||
|
@ -257,6 +270,9 @@ if [[ "$CMD" =~ ^(update|run|serve|compare|import)$ ]]; then
|
|||
shift
|
||||
compare_wpt
|
||||
;;
|
||||
list-tests)
|
||||
list_tests_wpt
|
||||
;;
|
||||
esac
|
||||
else
|
||||
>&2 echo "Unknown command: $CMD"
|
||||
|
|
Loading…
Add table
Reference in a new issue