Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 // rest. They use the .dart suffix in the status files. They | 377 // rest. They use the .dart suffix in the status files. They |
| 378 // find tests in weird ways (testing that they contain "#"). | 378 // find tests in weird ways (testing that they contain "#"). |
| 379 // They need to be redone. | 379 // They need to be redone. |
| 380 // TODO(1058): This does not work on Windows. | 380 // TODO(1058): This does not work on Windows. |
| 381 start = filename.indexOf(directoryPath); | 381 start = filename.indexOf(directoryPath); |
| 382 if (start != -1) { | 382 if (start != -1) { |
| 383 testName = filename.substring(start + directoryPath.length + 1); | 383 testName = filename.substring(start + directoryPath.length + 1); |
| 384 } else { | 384 } else { |
| 385 testName = filename; | 385 testName = filename; |
| 386 } | 386 } |
| 387 | 387 String suffix = TestUtils.executableSuffix(configuration['compiler']); |
| 388 if (configuration['compiler'] != 'dartc' || | 388 if (configuration['compiler'] != 'dart_analyzer$suffix' || |
| 389 testName.endsWith('_test.dart')) { | 389 testName.endsWith('_test.dart')) { |
|
Bill Hesse
2012/06/12 12:19:46
I looked at this a couple of weeks ago, and came t
| |
| 390 if (testName.endsWith('.dart')) { | 390 if (testName.endsWith('.dart')) { |
| 391 testName = testName.substring(0, testName.length - 5); | 391 testName = testName.substring(0, testName.length - 5); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 int shards = configuration['shards']; | 395 int shards = configuration['shards']; |
| 396 if (shards > 1) { | 396 if (shards > 1) { |
| 397 int shard = configuration['shard']; | 397 int shard = configuration['shard']; |
| 398 if (testName.hashCode() % shards != shard - 1) { | 398 if (testName.hashCode() % shards != shard - 1) { |
| 399 return; | 399 return; |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1120 completeHandler, | 1120 completeHandler, |
| 1121 new Set<String>.from([PASS]))); | 1121 new Set<String>.from([PASS]))); |
| 1122 doDone(); | 1122 doDone(); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 void completeHandler(TestCase testCase) { | 1125 void completeHandler(TestCase testCase) { |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 void computeClassPath() { | 1128 void computeClassPath() { |
| 1129 classPath = Strings.join( | 1129 classPath = Strings.join( |
| 1130 ['$buildDir/compiler/lib/dartc.jar', | 1130 ['$buildDir/analyzer/util/analyzer/dart_analyzer.jar', |
| 1131 '$buildDir/compiler-tests.jar', | 1131 '$buildDir/analyzer/dart_analyzer_tests.jar', |
| 1132 '$buildDir/closure_out/compiler.jar', | |
| 1133 // Third party libraries. | 1132 // Third party libraries. |
| 1134 '$dartDir/third_party/args4j/2.0.12/args4j-2.0.12.jar', | 1133 '$dartDir/third_party/args4j/2.0.12/args4j-2.0.12.jar', |
| 1135 '$dartDir/third_party/guava/r09/guava-r09.jar', | 1134 '$dartDir/third_party/guava/r09/guava-r09.jar', |
| 1136 '$dartDir/third_party/rhino/1_7R3/js.jar', | 1135 '$dartDir/third_party/rhino/1_7R3/js.jar', |
| 1137 '$dartDir/third_party/hamcrest/v1_3/hamcrest-core-1.3.0RC2.jar', | 1136 '$dartDir/third_party/hamcrest/v1_3/hamcrest-core-1.3.0RC2.jar', |
| 1138 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', | 1137 '$dartDir/third_party/hamcrest/v1_3/hamcrest-generator-1.3.0RC2.jar', |
| 1139 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', | 1138 '$dartDir/third_party/hamcrest/v1_3/hamcrest-integration-1.3.0RC2.jar', |
| 1140 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', | 1139 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', |
| 1141 '$dartDir/third_party/junit/v4_8_2/junit.jar'], | 1140 '$dartDir/third_party/junit/v4_8_2/junit.jar'], |
| 1142 ':'); // Path separator. | 1141 ':'); // Path separator. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1186 } | 1185 } |
| 1187 return ''; | 1186 return ''; |
| 1188 } | 1187 } |
| 1189 | 1188 |
| 1190 static String executableName(Map configuration) { | 1189 static String executableName(Map configuration) { |
| 1191 String suffix = executableSuffix(configuration['compiler']); | 1190 String suffix = executableSuffix(configuration['compiler']); |
| 1192 switch (configuration['compiler']) { | 1191 switch (configuration['compiler']) { |
| 1193 case 'none': | 1192 case 'none': |
| 1194 return 'dart$suffix'; | 1193 return 'dart$suffix'; |
| 1195 case 'dartc': | 1194 case 'dartc': |
| 1196 return 'compiler/bin/dartc$suffix'; | 1195 return 'analyzer/bin/dart_analyzer$suffix'; |
| 1197 case 'dart2js': | 1196 case 'dart2js': |
| 1198 var prefix = ''; | 1197 var prefix = ''; |
| 1199 if (configuration['use_sdk']) { | 1198 if (configuration['use_sdk']) { |
| 1200 prefix = 'dart-sdk/bin/'; | 1199 prefix = 'dart-sdk/bin/'; |
| 1201 } | 1200 } |
| 1202 if (configuration['host_checked']) { | 1201 if (configuration['host_checked']) { |
| 1203 // The script dart2js_developer is not in the SDK. | 1202 // The script dart2js_developer is not in the SDK. |
| 1204 return 'dart2js_developer$suffix'; | 1203 return 'dart2js_developer$suffix'; |
| 1205 } else { | 1204 } else { |
| 1206 return '${prefix}dart2js$suffix'; | 1205 return '${prefix}dart2js$suffix'; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1358 * $noCrash tests are expected to be flaky but not crash | 1357 * $noCrash tests are expected to be flaky but not crash |
| 1359 * $pass tests are expected to pass | 1358 * $pass tests are expected to pass |
| 1360 * $failOk tests are expected to fail that we won't fix | 1359 * $failOk tests are expected to fail that we won't fix |
| 1361 * $fail tests are expected to fail that we should fix | 1360 * $fail tests are expected to fail that we should fix |
| 1362 * $crash tests are expected to crash that we should fix | 1361 * $crash tests are expected to crash that we should fix |
| 1363 * $timeout tests are allowed to timeout | 1362 * $timeout tests are allowed to timeout |
| 1364 """; | 1363 """; |
| 1365 print(report); | 1364 print(report); |
| 1366 } | 1365 } |
| 1367 } | 1366 } |
| OLD | NEW |