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("test_suite"); | 5 #library("test_suite"); |
6 | 6 |
7 #import("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
8 #import("test_runner.dart"); | 8 #import("test_runner.dart"); |
9 #import("multitest.dart"); | 9 #import("multitest.dart"); |
10 | 10 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 start = filename.lastIndexOf(pathSeparator); | 234 start = filename.lastIndexOf(pathSeparator); |
235 int middle = filename.lastIndexOf('_'); | 235 int middle = filename.lastIndexOf('_'); |
236 testName = filename.substring(start + 1, middle) + pathSeparator + | 236 testName = filename.substring(start + 1, middle) + pathSeparator + |
237 filename.substring(middle + 1, filename.length - 5); | 237 filename.substring(middle + 1, filename.length - 5); |
238 } else { | 238 } else { |
239 // This case is hit by the dartc client compilation | 239 // This case is hit by the dartc client compilation |
240 // tests. These tests are pretty broken compared to the | 240 // tests. These tests are pretty broken compared to the |
241 // rest. They use the .dart suffix in the status files. They | 241 // rest. They use the .dart suffix in the status files. They |
242 // find tests in weird ways (testing that they contain "#"). | 242 // find tests in weird ways (testing that they contain "#"). |
243 // They need to be redone. | 243 // They need to be redone. |
244 start = filename.indexOf(directoryPath); | 244 // directoryPath may start with '../'. |
245 testName = filename.substring(start + directoryPath.length + 1, | 245 String sanitizedDirectoryPath = (directoryPath.startsWith('../')) ? |
| 246 directoryPath.substring(3) : directoryPath; |
| 247 start = filename.indexOf(sanitizedDirectoryPath); |
| 248 testName = filename.substring(start + sanitizedDirectoryPath.length + 1, |
246 filename.length); | 249 filename.length); |
247 if (configuration['component'] != 'dartc') { | 250 if (configuration['component'] != 'dartc') { |
248 if (testName.endsWith('.dart')) { | 251 if (testName.endsWith('.dart')) { |
249 testName = testName.substring(0, testName.length - 5); | 252 testName = testName.substring(0, testName.length - 5); |
250 } | 253 } |
251 } | 254 } |
252 } | 255 } |
253 Set<String> expectations = testExpectations.expectations(testName); | 256 Set<String> expectations = testExpectations.expectations(testName); |
254 if (configuration['report']) { | 257 if (configuration['report']) { |
255 // Tests with multiple VMOptions are counted more than once. | 258 // Tests with multiple VMOptions are counted more than once. |
256 for (var dummy in optionsFromFile["vmOptions"]) { | 259 for (var dummy in optionsFromFile["vmOptions"]) { |
257 SummaryReport.add(expectations); | 260 SummaryReport.add(expectations); |
258 } | 261 } |
259 } | 262 } |
260 if (expectations.contains(SKIP)) return; | 263 if (expectations.contains(SKIP)) return; |
261 | 264 |
262 switch (configuration['component']) { | 265 switch (configuration['component']) { |
263 case 'dartium': | 266 case 'dartium': |
264 case 'chromium': | 267 case 'chromium': |
265 case 'frogium': | 268 case 'frogium': |
266 enqueueBrowserTest(filename, testName,optionsFromFile, | 269 enqueueBrowserTest(filename, testName, optionsFromFile, |
267 expectations, isNegative); | 270 expectations, isNegative); |
268 break; | 271 break; |
269 default: | 272 default: |
270 // Only dartc supports fatal type errors. Enable fatal type | 273 // Only dartc supports fatal type errors. Enable fatal type |
271 // errors with a flag and treat tests that have fatal type | 274 // errors with a flag and treat tests that have fatal type |
272 // errors as negative. | 275 // errors as negative. |
273 var enableFatalTypeErrors = | 276 var enableFatalTypeErrors = |
274 (info.hasFatalTypeErrors && configuration['component'] == 'dartc'); | 277 (info.hasFatalTypeErrors && configuration['component'] == 'dartc'); |
275 var argumentLists = argumentListsFromFile(filename, | 278 var argumentLists = argumentListsFromFile(filename, |
276 optionsFromFile, | 279 optionsFromFile, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 { | 471 { |
469 String testUniqueName = | 472 String testUniqueName = |
470 testPath.substring(dartDir.length + 1, testPath.length - 5); | 473 testPath.substring(dartDir.length + 1, testPath.length - 5); |
471 testUniqueName = testUniqueName.replaceAll('/', '_'); | 474 testUniqueName = testUniqueName.replaceAll('/', '_'); |
472 // Create '[build dir]/generated_tests/$component/$testUniqueName', | 475 // Create '[build dir]/generated_tests/$component/$testUniqueName', |
473 // including any intermediate directories that don't exist. | 476 // including any intermediate directories that don't exist. |
474 var generatedTestPath = ['generated_tests', | 477 var generatedTestPath = ['generated_tests', |
475 configuration['component'], | 478 configuration['component'], |
476 testUniqueName]; | 479 testUniqueName]; |
477 | 480 |
478 Directory tempDir; | 481 String tempDirPath = TestUtils.buildDir(configuration); |
479 String tempDirPath = | 482 Directory tempDir = new Directory(tempDirPath); |
480 new File(TestUtils.buildDir(configuration)).fullPathSync(); | 483 if (!tempDir.existsSync()) { |
| 484 throw new Exception('Build directory $tempDirPath does not exist.'); |
| 485 } |
| 486 tempDirPath = new File(tempDirPath).fullPathSync(); |
| 487 |
481 for (String subdirectory in generatedTestPath) { | 488 for (String subdirectory in generatedTestPath) { |
482 tempDirPath = '$tempDirPath/$subdirectory'; | 489 tempDirPath = '$tempDirPath/$subdirectory'; |
483 tempDir = new Directory(tempDirPath); | 490 tempDir = new Directory(tempDirPath); |
484 if (!tempDir.existsSync()) { | 491 if (!tempDir.existsSync()) { |
485 tempDir.createSync(); | 492 tempDir.createSync(); |
486 } | 493 } |
487 } | 494 } |
488 return tempDir; | 495 return tempDir; |
489 } | 496 } |
490 | 497 |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 * $noCrash tests are expected to be flaky but not crash | 976 * $noCrash tests are expected to be flaky but not crash |
970 * $pass tests are expected to pass | 977 * $pass tests are expected to pass |
971 * $failOk tests are expected to fail that we won't fix | 978 * $failOk tests are expected to fail that we won't fix |
972 * $fail tests are expected to fail that we should fix | 979 * $fail tests are expected to fail that we should fix |
973 * $crash tests are expected to crash that we should fix | 980 * $crash tests are expected to crash that we should fix |
974 * $timeout tests are allowed to timeout\ | 981 * $timeout tests are allowed to timeout\ |
975 """; | 982 """; |
976 print(report); | 983 print(report); |
977 } | 984 } |
978 } | 985 } |
OLD | NEW |