Chromium Code Reviews| Index: tools/testing/dart/test_suite.dart |
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
| index 3f698a6bf7ebf90a8294ae7548606c309337221f..acbb7c3ce4b545bbb68965cc4d6068973d9b6084 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -100,6 +100,7 @@ class CCTestListerIsolate extends Isolate { |
| class CCTestSuite implements TestSuite { |
| Map configuration; |
| final String suiteName; |
| + final String testPrefix; |
| String runnerPath; |
| final String dartDir; |
| List<String> statusFilePaths; |
| @@ -109,10 +110,12 @@ class CCTestSuite implements TestSuite { |
| TestExpectations testExpectations; |
| CCTestSuite(Map this.configuration, |
| - String this.suiteName, |
| + String suiteAndPrefix, |
|
Ivan Posva
2012/05/02 20:05:15
The other option would be to pass an additional pa
Siggi Cherem (dart-lang)
2012/05/02 20:34:39
Done.
|
| String runnerName, |
| List<String> this.statusFilePaths) |
| - : dartDir = TestUtils.dartDir() { |
| + : dartDir = TestUtils.dartDir(), |
| + suiteName = _suiteName(suiteAndPrefix), |
|
Siggi Cherem (dart-lang)
2012/05/02 17:47:03
I'm not convinced this is the best approach to do
Ivan Posva
2012/05/02 20:05:15
Another option would be that the CCTestSuite expec
Siggi Cherem (dart-lang)
2012/05/02 20:34:39
Done.
|
| + testPrefix = _testPrefix(suiteAndPrefix) { |
| runnerPath = TestUtils.buildDir(configuration) + '/' + runnerName; |
| } |
| @@ -124,10 +127,11 @@ class CCTestSuite implements TestSuite { |
| // Only run the tests that match the pattern. Use the name |
| // "suiteName/testName" for cc tests. |
| RegExp pattern = configuration['selectors'][suiteName]; |
| - String constructedName = '$suiteName/$testName'; |
| + String constructedName = '$suiteName/$testPrefix$testName'; |
| if (!pattern.hasMatch(constructedName)) return; |
| - var expectations = testExpectations.expectations(testName); |
| + var expectations = testExpectations.expectations( |
| + '$testPrefix$testName'); |
| if (configuration["report"]) { |
| SummaryReport.add(expectations); |
| @@ -140,7 +144,7 @@ class CCTestSuite implements TestSuite { |
| var args = [testName]; |
| args.addAll(TestUtils.standardOptions(configuration)); |
| - doTest(new TestCase('$suiteName/$testName', |
| + doTest(new TestCase(constructedName, |
| [new Command(runnerPath, args)], |
| configuration, |
| completeHandler, |
| @@ -176,6 +180,27 @@ class CCTestSuite implements TestSuite { |
| void completeHandler(TestCase testCase) { |
| } |
| + |
| + /** |
| + * Extract the suite name from a string that may include a test prefix, for |
| + * instance return "suite" if s = "suite/prefix" or if s = "suite". |
| + */ |
| + static _suiteName(String s) { |
| + int index = s.indexOf('/'); |
| + if (index == -1) return s; |
| + return s.substring(0, index); |
| + } |
| + |
| + /** |
| + * Returns a test prefix "prefix/" derived from a string of the form |
| + * "suite/prefix". If no prefix is specified (e.g. s = "suite") return an |
| + * empty string. |
| + */ |
| + static _testPrefix(String s) { |
| + int index = s.indexOf('/'); |
| + if (index == -1) return ''; |
| + return '${s.substring(index + 1)}/'; |
| + } |
| } |