Browse Source

Tests: Add log-file option to WPT runner script

Always dropping the log file in /tmp isn't the greatest DX for debugging
failures
Andrew Kaster 1 year ago
parent
commit
d057d24d72
1 changed files with 6 additions and 3 deletions
  1. 6 3
      Tests/LibWeb/WPT/run.sh

+ 6 - 3
Tests/LibWeb/WPT/run.sh

@@ -15,6 +15,8 @@ fi
                          which WebDriver)}"
 update_expectations_metadata=false
 remove_wpt_repository=false
+# Generate name for file with wpt run log
+wpt_run_log_filename="$(mktemp)"
 
 for arg in "$@"; do
   case $arg in
@@ -30,6 +32,10 @@ for arg in "$@"; do
         remove_wpt_repository=true
         shift
         ;;
+    --log-file=*)
+        wpt_run_log_filename="$(realpath "${arg#*=}")"
+        shift
+        ;;
     *)
         echo "Unknown argument ${arg}"
         exit 1
@@ -66,9 +72,6 @@ fi
 # Extract metadata.txt into directory with expectation files expected by WPT runner
 python3 ./concat-extract-metadata.py --extract metadata.txt metadata
 
-# Generate name for file with wpt run log
-wpt_run_log_filename="$(mktemp).txt"
-
 # Run tests.
 python3 ./wpt/wpt run ladybird \
                   --webdriver-binary "${WEBDRIVER_BINARY}" \