| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 296 } |
| 297 // Test if the selector includes this test. | 297 // Test if the selector includes this test. |
| 298 RegExp pattern = configuration['selectors'][suiteName]; | 298 RegExp pattern = configuration['selectors'][suiteName]; |
| 299 if (!pattern.hasMatch(testCase.displayName)) { | 299 if (!pattern.hasMatch(testCase.displayName)) { |
| 300 return; | 300 return; |
| 301 } | 301 } |
| 302 | 302 |
| 303 if (configuration['hot_reload']) { | 303 if (configuration['hot_reload']) { |
| 304 // Handle reload special cases. | 304 // Handle reload special cases. |
| 305 if (expectations.contains(Expectation.COMPILETIME_ERROR)) { | 305 if (expectations.contains(Expectation.COMPILETIME_ERROR)) { |
| 306 // Skip reloading tests with expected compilation errors. | 306 // Running a test that expects a compilation error with hot reloading |
| 307 // is redundant with a regular run of the test. |
| 307 return; | 308 return; |
| 308 } | 309 } |
| 309 } | 310 } |
| 310 | 311 |
| 311 // Update Summary report | 312 // Update Summary report |
| 312 if (configuration['report']) { | 313 if (configuration['report']) { |
| 313 if (testCase.expectCompileError && | 314 if (testCase.expectCompileError && |
| 314 TestUtils.isBrowserRuntime(configuration['runtime']) && | 315 TestUtils.isBrowserRuntime(configuration['runtime']) && |
| 315 new CompilerConfiguration(configuration).hasCompiler) { | 316 new CompilerConfiguration(configuration).hasCompiler) { |
| 316 summaryReport.addCompileErrorSkipTest(); | 317 summaryReport.addCompileErrorSkipTest(); |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 enqueueTestCaseFromTestInformation(info); | 839 enqueueTestCaseFromTestInformation(info); |
| 839 return; | 840 return; |
| 840 } | 841 } |
| 841 if (!isTestFile(filename)) return; | 842 if (!isTestFile(filename)) return; |
| 842 Path filePath = new Path(filename); | 843 Path filePath = new Path(filename); |
| 843 | 844 |
| 844 var optionsFromFile = readOptionsFromFile(filePath); | 845 var optionsFromFile = readOptionsFromFile(filePath); |
| 845 CreateTest createTestCase = makeTestCaseCreator(optionsFromFile); | 846 CreateTest createTestCase = makeTestCaseCreator(optionsFromFile); |
| 846 | 847 |
| 847 if (optionsFromFile['isMultitest']) { | 848 if (optionsFromFile['isMultitest']) { |
| 848 group.add(doMultitest(filePath, buildDir, suiteDir, createTestCase)); | 849 group.add(doMultitest(filePath, |
| 850 buildDir, |
| 851 suiteDir, |
| 852 createTestCase, |
| 853 configuration['hot_reload'])); |
| 849 } else { | 854 } else { |
| 850 createTestCase(filePath, filePath, optionsFromFile['hasCompileError'], | 855 createTestCase(filePath, filePath, optionsFromFile['hasCompileError'], |
| 851 optionsFromFile['hasRuntimeError'], | 856 optionsFromFile['hasRuntimeError'], |
| 852 hasStaticWarning: optionsFromFile['hasStaticWarning']); | 857 hasStaticWarning: optionsFromFile['hasStaticWarning']); |
| 853 } | 858 } |
| 854 } | 859 } |
| 855 | 860 |
| 856 static Path _findPubspecYamlFile(Path filePath) { | 861 static Path _findPubspecYamlFile(Path filePath) { |
| 857 final existsCache = TestUtils.existsCache; | 862 final existsCache = TestUtils.existsCache; |
| 858 | 863 |
| (...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2478 } | 2483 } |
| 2479 if (path.length > WINDOWS_SHORTEN_PATH_LIMIT) { | 2484 if (path.length > WINDOWS_SHORTEN_PATH_LIMIT) { |
| 2480 ++shortNameCounter; | 2485 ++shortNameCounter; |
| 2481 var pathEnd = path.substring(path.length - WINDOWS_PATH_END_LENGTH); | 2486 var pathEnd = path.substring(path.length - WINDOWS_PATH_END_LENGTH); |
| 2482 path = "short${shortNameCounter}_$pathEnd"; | 2487 path = "short${shortNameCounter}_$pathEnd"; |
| 2483 } | 2488 } |
| 2484 } | 2489 } |
| 2485 return path; | 2490 return path; |
| 2486 } | 2491 } |
| 2487 } | 2492 } |
| OLD | NEW |