[go: nahoru, domu]

Add generator_script and modify BUILD to generate a wrapper script that runs layout tests with build target prefilled

Bug: 897803
Change-Id: I21c00b8924e38304903cf10840fdf5bea1ebb864
Reviewed-on: https://chromium-review.googlesource.com/c/1296990
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605539}
diff --git a/BUILD.gn b/BUILD.gn
index 4d47b83..bc020b8b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -26,6 +26,7 @@
 import("//v8/gni/v8.gni")
 import("//v8/snapshot_toolchain.gni")
 import("//gpu/vulkan/features.gni")
+import("//testing/test.gni")
 
 if (is_android) {
   import("//build/config/android/config.gni")
@@ -934,8 +935,21 @@
   # and is useful for testing with the regular isolate mechanism.
   # To run the full layout test suite you need to use
   # :webkit_layout_tests_exparchive, above, instead.
-  group("webkit_layout_tests") {
-    testonly = true
+  generated_script_test("webkit_layout_tests") {
+    generator_script = "//testing/scripts/generators/gen_run_web_tests_script.py"
+    extra_args = []
+    if (is_debug) {
+      extra_args += [
+        "--build-type",
+        "debug",
+      ]
+    } else {
+      extra_args += [
+        "--build-type",
+        "release",
+      ]
+    }
+
     data_deps = [
       ":layout_test_data_mojo_bindings",
       ":layout_test_data_mojo_bindings_lite",