Skip to content

Commit

Permalink
Meta: Strip query string from WPT test variants before importing them
Browse files Browse the repository at this point in the history
The output of `WPT.sh list-tests` includes test variants, which vary
only by their query string. Since we don't care about this when
importing tests, ignore any query strings and ensure duplicates are
removed from the given test paths.
  • Loading branch information
tcl3 committed Dec 19, 2024
1 parent c89680b commit 3f11b87
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Meta/WPT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,22 @@ import_wpt()
INPUT_PATHS[i]="$item"
done

TESTS=()
RAW_TESTS=()
while IFS= read -r test_file; do
TESTS+=("$test_file")
RAW_TESTS+=("${test_file%%\?*}")
done < <(
"${ARG0}" list-tests "${INPUT_PATHS[@]}"
)
if [ "${#TESTS[@]}" -eq 0 ]; then
if [ "${#RAW_TESTS[@]}" -eq 0 ]; then
echo "No tests found for the given paths"
exit 1
fi

TESTS=()
while IFS= read -r test_file; do
TESTS+=("$test_file")
done < <(printf "%s\n" "${RAW_TESTS[@]}" | sort -u)

pushd "${LADYBIRD_SOURCE_DIR}" > /dev/null
./Meta/ladybird.sh build headless-browser
set +e
Expand Down

0 comments on commit 3f11b87

Please sign in to comment.