Tests: Enable WPT/run.sh to run an arbitrary subset of tests

The change causes Tests/LibWeb/WPT/run.sh to run an arbitrary subset of
tests you give it as arguments. If you don’t specify any arguments, it
has the same behavior as it does without this patch: It just runs an
explicit subset of test names hardcoded into the script.

Otherwise without this change, Tests/LibWeb/WPT/run.sh doesn’t have the
ability to run any tests other than the explicit subset of test names
hardcoded into the script
This commit is contained in:
sideshowbarker 2024-07-16 04:56:04 +09:00 committed by Andrew Kaster
parent 7c0aa88e99
commit cc6d502e88
Notes: sideshowbarker 2024-07-18 02:44:38 +09:00

View file

@ -36,10 +36,15 @@ for arg in "$@"; do
wpt_run_log_filename="$(realpath "${arg#*=}")" wpt_run_log_filename="$(realpath "${arg#*=}")"
shift shift
;; ;;
-*)
echo "Unknown argument $arg"
exit 1
;;
*) *)
echo "Unknown argument ${arg}" TEST_FILE=$(realpath "$arg")
exit 1 TEST_FILES+=("$TEST_FILE")
;; shift
;;
esac esac
done done
@ -73,7 +78,7 @@ fi
python3 ./concat-extract-metadata.py --extract metadata.txt metadata python3 ./concat-extract-metadata.py --extract metadata.txt metadata
# Run tests. # Run tests.
python3 ./wpt/wpt run ladybird \ python3 ./wpt/wpt run \
--webdriver-binary "${WEBDRIVER_BINARY}" \ --webdriver-binary "${WEBDRIVER_BINARY}" \
--no-fail-on-unexpected \ --no-fail-on-unexpected \
--no-fail-on-unexpected-pass \ --no-fail-on-unexpected-pass \
@ -83,7 +88,9 @@ python3 ./wpt/wpt run ladybird \
--manifest ./MANIFEST.json \ --manifest ./MANIFEST.json \
--webdriver-arg="--certificate=${PWD}/wpt/tools/certs/cacert.pem" \ --webdriver-arg="--certificate=${PWD}/wpt/tools/certs/cacert.pem" \
--webdriver-arg="--certificate=${LADYBIRD_SOURCE_DIR}/Build/lagom/cacert.pem" \ --webdriver-arg="--certificate=${LADYBIRD_SOURCE_DIR}/Build/lagom/cacert.pem" \
--log-raw "${wpt_run_log_filename}" --log-raw "${wpt_run_log_filename}" \
ladybird \
${TEST_FILES:+"${TEST_FILES[@]}"}
# Update expectations metadata files if requested # Update expectations metadata files if requested
if [[ $update_expectations_metadata == true ]]; then if [[ $update_expectations_metadata == true ]]; then