Add a filter argument to WSL test suite.
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Aug 2017 19:42:00 +0000 (19:42 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Aug 2017 19:42:00 +0000 (19:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176176

Reviewed by Filip Pizlo.

* WebGPUShadingLanguageRI/Test.js:
(this.string_appeared_here.i.switch):
(let.s.in.this.s.startsWith.string_appeared_here.s.match):
(let.s.in.this.s.startsWith): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221435 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/WebGPUShadingLanguageRI/Test.js

index 2ae3a10..e1de57c 100644 (file)
@@ -1,3 +1,15 @@
+2017-08-31  Keith Miller  <keith_miller@apple.com>
+
+        Add a filter argument to WSL test suite.
+        https://bugs.webkit.org/show_bug.cgi?id=176176
+
+        Reviewed by Filip Pizlo.
+
+        * WebGPUShadingLanguageRI/Test.js:
+        (this.string_appeared_here.i.switch):
+        (let.s.in.this.s.startsWith.string_appeared_here.s.match):
+        (let.s.in.this.s.startsWith): Deleted.
+
 2017-08-30  Filip Pizlo  <fpizlo@apple.com>
 
         WSL should be able to run a program that uses generics
index 616e2bb..7071279 100644 (file)
@@ -49,8 +49,22 @@ function TEST_simpleGeneric() {
 
 let before = preciseTime();
 
+let filter = /.*/; // run everything by default
+if (this["arguments"]) {
+    for (let i = 0; i < arguments.length; i++) {
+        switch (arguments[0]) {
+        case "--filter":
+            filter = new RegExp(arguments[++i]);
+            break;
+        default:
+            throw new Error("Unknown argument: ", arguments[i]);
+        }
+    }
+}
+
+
 for (let s in this) {
-    if (s.startsWith("TEST_")) {
+    if (s.startsWith("TEST_") && s.match(filter)) {
         print(s + "...");
         this[s]();
         print("    OK!");