Title: [104343] trunk/Tools
Revision
104343
Author
[email protected]
Date
2012-01-06 14:46:20 -0800 (Fri, 06 Jan 2012)

Log Message

run-api-tests: specify individual suites and tests on the command-line

Reviewed by Adam Roben.

Fixes: <http://webkit.org/b/75065> run-api-tests should be able to run individual suites and tests

The run-api-tests script will now accept a list of arguments on
the command-line that are used as prefix filters.  To run all
tests in a suite that starts with "WTF" (WTF and WTF_Vector)
use:

    $ run-api-tests WTF

To run only the tests in the "WTF" suite, not the "WTF_Vector"
suite, use:

    $ run-api-tests WTF.

* Scripts/run-api-tests: Filter tests if any prefix arguments
are passed on the command-line.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (104342 => 104343)


--- trunk/Tools/ChangeLog	2012-01-06 22:46:12 UTC (rev 104342)
+++ trunk/Tools/ChangeLog	2012-01-06 22:46:20 UTC (rev 104343)
@@ -1,5 +1,28 @@
 2012-01-06  David Kilzer  <[email protected]>
 
+        run-api-tests: specify individual suites and tests on the command-line
+
+        Reviewed by Adam Roben.
+
+        Fixes: <http://webkit.org/b/75065> run-api-tests should be able to run individual suites and tests
+
+        The run-api-tests script will now accept a list of arguments on
+        the command-line that are used as prefix filters.  To run all
+        tests in a suite that starts with "WTF" (WTF and WTF_Vector)
+        use:
+
+            $ run-api-tests WTF
+
+        To run only the tests in the "WTF" suite, not the "WTF_Vector"
+        suite, use:
+
+            $ run-api-tests WTF.
+
+        * Scripts/run-api-tests: Filter tests if any prefix arguments
+        are passed on the command-line.
+
+2012-01-06  David Kilzer  <[email protected]>
+
         run-api-tests: change internal representation of tests to array of "SuiteName.TestName" strings
 
         Reviewed by Adam Roben.

Modified: trunk/Tools/Scripts/run-api-tests (104342 => 104343)


--- trunk/Tools/Scripts/run-api-tests	2012-01-06 22:46:12 UTC (rev 104342)
+++ trunk/Tools/Scripts/run-api-tests	2012-01-06 22:46:20 UTC (rev 104343)
@@ -23,10 +23,6 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
 
-# Features to add:
-#   - Command line option to run a single test.
-#   - Command line option to run all tests in a suite.
-
 use strict;
 use warnings;
 
@@ -62,7 +58,7 @@
 
 my $programName = basename($0);
 my $usage = <<EOF;
-Usage: $programName [options]
+Usage: $programName [options] [suite or test prefixes]
   --help                Show this help message
   -v|--verbose          Verbose output
   -d|--dump-tests       Dump the names of testcases without running them
@@ -87,14 +83,14 @@
 setPathForRunningWebKitApp(\%ENV);
 my @testsToRun = listAllTests();
 
+@testsToRun = grep { my $test = $_; grep { $test =~ m/^\Q$_\E/ } @ARGV; } @testsToRun if @ARGV;
+
 if ($dumpTests) {
     dumpTestsBySuite(@testsToRun);
     exit 0;
 }
 
-if (runTestsBySuite(@testsToRun, $verbose)) {
-    exit 1;
-}
+exit runTestsBySuite(@testsToRun, $verbose);
 
 sub isSupportedPlatform()
 {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to