| 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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 while ('${tempDir.path}/../$htmlFilename'.length >= 260) { | 588 while ('${tempDir.path}/../$htmlFilename'.length >= 260) { |
| 589 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); | 589 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); |
| 590 } | 590 } |
| 591 htmlPath = '${tempDir.path}/../$htmlFilename'; | 591 htmlPath = '${tempDir.path}/../$htmlFilename'; |
| 592 } | 592 } |
| 593 final String scriptPath = (compiler == 'none') ? | 593 final String scriptPath = (compiler == 'none') ? |
| 594 dartWrapperFilename : compiledDartWrapperFilename; | 594 dartWrapperFilename : compiledDartWrapperFilename; |
| 595 // Create the HTML file for the test. | 595 // Create the HTML file for the test. |
| 596 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); | 596 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); |
| 597 String filePrefix = ''; | 597 String filePrefix = ''; |
| 598 if (Platform.operatingSystem() == 'windows') { | 598 if (Platform.operatingSystem == 'windows') { |
| 599 // Firefox on Windows does not like absolute file path names that start | 599 // Firefox on Windows does not like absolute file path names that start |
| 600 // with 'C:' adding 'file:///' solves the problem. | 600 // with 'C:' adding 'file:///' solves the problem. |
| 601 filePrefix = 'file:///'; | 601 filePrefix = 'file:///'; |
| 602 } | 602 } |
| 603 htmlTest.writeStringSync(GetHtmlContents( | 603 htmlTest.writeStringSync(GetHtmlContents( |
| 604 filename, | 604 filename, |
| 605 '$filePrefix$dartDir/lib/unittest/test_controller.js', | 605 '$filePrefix$dartDir/lib/unittest/test_controller.js', |
| 606 scriptType, | 606 scriptType, |
| 607 filePrefix + scriptPath)); | 607 filePrefix + scriptPath)); |
| 608 htmlTest.closeSync(); | 608 htmlTest.closeSync(); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 String getHtmlName(String filename) { | 809 String getHtmlName(String filename) { |
| 810 return filename.replaceAll('/', '_').replaceAll(':', '_') | 810 return filename.replaceAll('/', '_').replaceAll(':', '_') |
| 811 .replaceAll('\\', '_') + configuration['compiler'] + '-' + | 811 .replaceAll('\\', '_') + configuration['compiler'] + '-' + |
| 812 configuration['runtime'] + '.html'; | 812 configuration['runtime'] + '.html'; |
| 813 } | 813 } |
| 814 | 814 |
| 815 String get dumpRenderTreeFilename() { | 815 String get dumpRenderTreeFilename() { |
| 816 if (configuration['drt'] != '') { | 816 if (configuration['drt'] != '') { |
| 817 return configuration['drt']; | 817 return configuration['drt']; |
| 818 } | 818 } |
| 819 if (Platform.operatingSystem() == 'macos') { | 819 if (Platform.operatingSystem == 'macos') { |
| 820 return '$dartDir/client/tests/drt/DumpRenderTree.app/Contents/' | 820 return '$dartDir/client/tests/drt/DumpRenderTree.app/Contents/' |
| 821 'MacOS/DumpRenderTree'; | 821 'MacOS/DumpRenderTree'; |
| 822 } | 822 } |
| 823 return '$dartDir/client/tests/drt/DumpRenderTree'; | 823 return '$dartDir/client/tests/drt/DumpRenderTree'; |
| 824 } | 824 } |
| 825 | 825 |
| 826 String get dartiumFilename() { | 826 String get dartiumFilename() { |
| 827 if (configuration['dartium'] != '') { | 827 if (configuration['dartium'] != '') { |
| 828 return configuration['dartium']; | 828 return configuration['dartium']; |
| 829 } | 829 } |
| 830 if (Platform.operatingSystem() == 'macos') { | 830 if (Platform.operatingSystem == 'macos') { |
| 831 return '$dartDir/client/tests/dartium/Chromium.app/Contents/' | 831 return '$dartDir/client/tests/dartium/Chromium.app/Contents/' |
| 832 'MacOS/Chromium'; | 832 'MacOS/Chromium'; |
| 833 } | 833 } |
| 834 return '$dartDir/client/tests/dartium/chrome'; | 834 return '$dartDir/client/tests/dartium/chrome'; |
| 835 } | 835 } |
| 836 | 836 |
| 837 void testGeneratorStarted() { | 837 void testGeneratorStarted() { |
| 838 ++activeTestGenerators; | 838 ++activeTestGenerators; |
| 839 } | 839 } |
| 840 | 840 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 * Assumes that the directory for [dest] already exists. | 1213 * Assumes that the directory for [dest] already exists. |
| 1214 */ | 1214 */ |
| 1215 static void copyFile(File source, File dest) { | 1215 static void copyFile(File source, File dest) { |
| 1216 List contents = source.readAsBytesSync(); | 1216 List contents = source.readAsBytesSync(); |
| 1217 RandomAccessFile handle = dest.openSync(FileMode.WRITE); | 1217 RandomAccessFile handle = dest.openSync(FileMode.WRITE); |
| 1218 handle.writeListSync(contents, 0, contents.length); | 1218 handle.writeListSync(contents, 0, contents.length); |
| 1219 handle.closeSync(); | 1219 handle.closeSync(); |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 static String executableSuffix(String executable) { | 1222 static String executableSuffix(String executable) { |
| 1223 if (Platform.operatingSystem() == 'windows') { | 1223 if (Platform.operatingSystem == 'windows') { |
| 1224 if (executable == 'd8' || executable == 'vm' || executable == 'none') { | 1224 if (executable == 'd8' || executable == 'vm' || executable == 'none') { |
| 1225 return '.exe'; | 1225 return '.exe'; |
| 1226 } else { | 1226 } else { |
| 1227 return '.bat'; | 1227 return '.bat'; |
| 1228 } | 1228 } |
| 1229 } | 1229 } |
| 1230 return ''; | 1230 return ''; |
| 1231 } | 1231 } |
| 1232 | 1232 |
| 1233 static String executableName(Map configuration) { | 1233 static String executableName(Map configuration) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1399 * $noCrash tests are expected to be flaky but not crash | 1399 * $noCrash tests are expected to be flaky but not crash |
| 1400 * $pass tests are expected to pass | 1400 * $pass tests are expected to pass |
| 1401 * $failOk tests are expected to fail that we won't fix | 1401 * $failOk tests are expected to fail that we won't fix |
| 1402 * $fail tests are expected to fail that we should fix | 1402 * $fail tests are expected to fail that we should fix |
| 1403 * $crash tests are expected to crash that we should fix | 1403 * $crash tests are expected to crash that we should fix |
| 1404 * $timeout tests are allowed to timeout | 1404 * $timeout tests are allowed to timeout |
| 1405 """; | 1405 """; |
| 1406 print(report); | 1406 print(report); |
| 1407 } | 1407 } |
| 1408 } | 1408 } |
| OLD | NEW |