Meta: Add a command to WPT.sh to execute wpt serve

Just a handy command for local testing.
This commit is contained in:
Timothy Flynn 2024-10-11 14:30:24 -04:00 committed by Andreas Kling
parent 8598ed86fe
commit bd8ab33593
Notes: github-actions[bot] 2024-10-12 13:03:42 +00:00

View file

@ -148,6 +148,15 @@ run_wpt() {
execute_wpt execute_wpt
} }
serve_wpt()
{
ensure_wpt_repository
pushd "${WPT_SOURCE_DIR}" > /dev/null
./wpt serve
popd > /dev/null
}
compare_wpt() { compare_wpt() {
ensure_wpt_repository ensure_wpt_repository
METADATA_DIR=$(mktemp -d) METADATA_DIR=$(mktemp -d)
@ -160,7 +169,7 @@ compare_wpt() {
rm -rf "${METADATA_DIR}" rm -rf "${METADATA_DIR}"
} }
if [[ "$CMD" =~ ^(update|run|compare)$ ]]; then if [[ "$CMD" =~ ^(update|run|serve|compare)$ ]]; then
case "$CMD" in case "$CMD" in
update) update)
update_wpt update_wpt
@ -168,6 +177,9 @@ if [[ "$CMD" =~ ^(update|run|compare)$ ]]; then
run) run)
run_wpt run_wpt
;; ;;
serve)
serve_wpt
;;
compare) compare)
INPUT_LOG_NAME="$(pwd -P)/$1" INPUT_LOG_NAME="$(pwd -P)/$1"
if [ ! -f "$INPUT_LOG_NAME" ]; then if [ ! -f "$INPUT_LOG_NAME" ]; then