| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library("stub_generator_test_config"); | 5 #library("stub_generator_test_config"); |
| 6 | 6 |
| 7 #import("../../tools/testing/dart/test_suite.dart"); | 7 #import("../../tools/testing/dart/test_suite.dart"); |
| 8 | 8 |
| 9 class StubGeneratorTestSuite extends StandardTestSuite { | 9 class StubGeneratorTestSuite extends StandardTestSuite { |
| 10 String dartcPath; | 10 String dartcPath; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 combineFiles(filename, stubsPath, onGenerated); | 94 combineFiles(filename, stubsPath, onGenerated); |
| 95 }; | 95 }; |
| 96 dartcProcess.start(); | 96 dartcProcess.start(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void processFile(String filename) { | 99 void processFile(String filename) { |
| 100 // Only run the tests that match the pattern. | 100 // Only run the tests that match the pattern. |
| 101 RegExp pattern = configuration['selectors'][suiteName]; | 101 RegExp pattern = configuration['selectors'][suiteName]; |
| 102 if (!pattern.hasMatch(filename)) return; | 102 if (!pattern.hasMatch(filename)) return; |
| 103 var optionsFromFile = optionsFromFile(filename); | 103 var optionsFromFile = optionsFromFile(filename); |
| 104 var timeout = configuration['timeout']; | 104 Function createTestCase = |
| 105 Function createTestCase = makeTestCaseCreator(optionsFromFile, timeout); | 105 makeTestCaseCreator(optionsFromFile, configuration); |
| 106 | 106 |
| 107 if (filename.endsWith("-generatedTest.dart")) { | 107 if (filename.endsWith("-generatedTest.dart")) { |
| 108 if (dartcPath == null) { | 108 if (dartcPath == null) { |
| 109 createTestCase(filename, optionsFromFile['isNegative']); | 109 createTestCase(filename, optionsFromFile['isNegative']); |
| 110 } | 110 } |
| 111 } else if (filename.endsWith("Test.dart")) { | 111 } else if (filename.endsWith("Test.dart")) { |
| 112 if (dartcPath != null) { | 112 if (dartcPath != null) { |
| 113 String isolateStubsOptions = optionsFromFile['isolateStubs']; | 113 String isolateStubsOptions = optionsFromFile['isolateStubs']; |
| 114 List<String> splitIsolateStubsOptions = isolateStubsOptions.split(':'); | 114 List<String> splitIsolateStubsOptions = isolateStubsOptions.split(':'); |
| 115 Expect.equals(2, splitIsolateStubsOptions.length); | 115 Expect.equals(2, splitIsolateStubsOptions.length); |
| 116 String interfaceFile = splitIsolateStubsOptions[0]; | 116 String interfaceFile = splitIsolateStubsOptions[0]; |
| 117 String classes = splitIsolateStubsOptions[1]; | 117 String classes = splitIsolateStubsOptions[1]; |
| 118 generateTestCase(filename, interfaceFile, classes, (String filename) { | 118 generateTestCase(filename, interfaceFile, classes, (String filename) { |
| 119 createTestCase(filename, optionsFromFile['isNegative']); | 119 createTestCase(filename, optionsFromFile['isNegative']); |
| 120 testGeneratorDone(); | 120 testGeneratorDone(); |
| 121 }); | 121 }); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 } | 125 } |
| OLD | NEW |