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, |
| 11 * and creating [TestCase]s for those files that meet the relevant criteria. | 11 * and creating [TestCase]s for those files that meet the relevant criteria. |
| 12 * - Preparing tests, including copying files and frameworks to temporary | 12 * - Preparing tests, including copying files and frameworks to temporary |
| 13 * directories, and computing the command line and arguments to be run. | 13 * directories, and computing the command line and arguments to be run. |
| 14 */ | 14 */ |
| 15 import 'dart:async'; | 15 import 'dart:async'; |
| 16 import 'dart:io'; | 16 import 'dart:io'; |
| 17 | 17 |
| 18 import 'browser_test.dart'; | 18 import 'browser_test.dart'; |
| 19 import 'command.dart'; | 19 import 'command.dart'; |
| 20 import 'compiler_configuration.dart'; | 20 import 'compiler_configuration.dart'; |
| 21 import 'configuration.dart'; | 21 import 'configuration.dart'; |
| 22 import 'drt_updater.dart'; | |
| 23 import 'expectation.dart'; | 22 import 'expectation.dart'; |
| 24 import 'expectation_set.dart'; | 23 import 'expectation_set.dart'; |
| 25 import 'html_test.dart' as html_test; | 24 import 'html_test.dart' as html_test; |
| 26 import 'http_server.dart'; | 25 import 'http_server.dart'; |
| 27 import 'multitest.dart'; | 26 import 'multitest.dart'; |
| 28 import 'path.dart'; | 27 import 'path.dart'; |
| 28 import 'runtime_updater.dart'; | |
| 29 import 'summary_report.dart'; | 29 import 'summary_report.dart'; |
| 30 import 'test_configurations.dart'; | 30 import 'test_configurations.dart'; |
| 31 import 'test_runner.dart'; | 31 import 'test_runner.dart'; |
| 32 import 'utils.dart'; | 32 import 'utils.dart'; |
| 33 | 33 |
| 34 RegExp multiHtmlTestGroupRegExp = new RegExp(r"\s*[^/]\s*group\('[^,']*"); | 34 RegExp multiHtmlTestGroupRegExp = new RegExp(r"\s*[^/]\s*group\('[^,']*"); |
| 35 RegExp multiHtmlTestRegExp = new RegExp(r"useHtmlIndividualConfiguration()"); | 35 RegExp multiHtmlTestRegExp = new RegExp(r"useHtmlIndividualConfiguration()"); |
| 36 // Require at least one non-space character before '//[/#]' | 36 // Require at least one non-space character before '//[/#]' |
| 37 RegExp multiTestRegExp = new RegExp(r"\S *" | 37 RegExp multiTestRegExp = new RegExp(r"\S *" |
| 38 r"//[#/] \w+:(.*)"); | 38 r"//[#/] \w+:(.*)"); |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 639 return filename.endsWith("Test.dart"); | 639 return filename.endsWith("Test.dart"); |
| 640 } | 640 } |
| 641 | 641 |
| 642 bool isHtmlTestFile(String filename) => filename.endsWith('_htmltest.html'); | 642 bool isHtmlTestFile(String filename) => filename.endsWith('_htmltest.html'); |
| 643 | 643 |
| 644 List<String> additionalOptions(Path filePath) => []; | 644 List<String> additionalOptions(Path filePath) => []; |
| 645 | 645 |
| 646 Future forEachTest( | 646 Future forEachTest( |
| 647 Function onTest, Map<String, List<TestInformation>> testCache, | 647 Function onTest, Map<String, List<TestInformation>> testCache, |
| 648 [VoidFunction onDone]) async { | 648 [VoidFunction onDone]) async { |
| 649 await updateDartium(); | 649 if (!configuration.listTests) { |
| 650 await updateContentShell(configuration.runtime, configuration.drtPath); | |
| 651 } | |
| 652 | |
| 650 doTest = onTest; | 653 doTest = onTest; |
| 651 testExpectations = readExpectations(); | 654 testExpectations = readExpectations(); |
| 652 | 655 |
| 653 // Check if we have already found and generated the tests for this suite. | 656 // Check if we have already found and generated the tests for this suite. |
| 654 if (!testCache.containsKey(suiteName)) { | 657 if (!testCache.containsKey(suiteName)) { |
| 655 cachedTests = testCache[suiteName] = <TestInformation>[]; | 658 cachedTests = testCache[suiteName] = <TestInformation>[]; |
| 656 await enqueueTests(); | 659 await enqueueTests(); |
| 657 } else { | 660 } else { |
| 658 for (var info in testCache[suiteName]) { | 661 for (var info in testCache[suiteName]) { |
| 659 enqueueTestCaseFromTestInformation(info); | 662 enqueueTestCaseFromTestInformation(info); |
| 660 } | 663 } |
| 661 } | 664 } |
| 662 testExpectations = null; | 665 testExpectations = null; |
| 663 cachedTests = null; | 666 cachedTests = null; |
| 664 doTest = null; | 667 doTest = null; |
| 665 if (onDone != null) onDone(); | 668 if (onDone != null) onDone(); |
| 666 } | 669 } |
| 667 | 670 |
| 668 /** | 671 /** |
| 669 * If Content shell/Dartium is required, and not yet updated, waits for | |
| 670 * the update then completes. Otherwise completes immediately. | |
| 671 */ | |
| 672 Future updateDartium() { | |
| 673 var completer = new Completer(); | |
| 674 var updater = runtimeUpdater(configuration.runtime, configuration.drtPath, | |
| 675 configuration.dartiumPath); | |
| 676 if (updater == null || updater.updated) { | |
| 677 return new Future.value(null); | |
| 678 } | |
| 679 | |
| 680 assert(updater.isActive); | |
| 681 updater.onUpdated.add(() => completer.complete(null)); | |
| 682 | |
| 683 return completer.future; | |
| 684 } | |
| 685 | |
| 686 /** | |
| 687 * Reads the status files and completes with the parsed expectations. | 672 * Reads the status files and completes with the parsed expectations. |
| 688 */ | 673 */ |
| 689 ExpectationSet readExpectations() { | 674 ExpectationSet readExpectations() { |
| 690 var statusFiles = statusFilePaths.where((String statusFilePath) { | 675 var statusFiles = statusFilePaths.where((String statusFilePath) { |
| 691 var file = new File(dartDir.append(statusFilePath).toNativePath()); | 676 var file = new File(dartDir.append(statusFilePath).toNativePath()); |
| 692 return file.existsSync(); | 677 return file.existsSync(); |
| 693 }).map((statusFilePath) { | 678 }).map((statusFilePath) { |
| 694 return dartDir.append(statusFilePath).toNativePath(); | 679 return dartDir.append(statusFilePath).toNativePath(); |
| 695 }).toList(); | 680 }).toList(); |
| 696 | 681 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1023 } | 1008 } |
| 1024 | 1009 |
| 1025 void _enqueueBrowserTestWithOptions( | 1010 void _enqueueBrowserTestWithOptions( |
| 1026 Path packageRoot, | 1011 Path packageRoot, |
| 1027 Path packages, | 1012 Path packages, |
| 1028 TestInformation info, | 1013 TestInformation info, |
| 1029 String testName, | 1014 String testName, |
| 1030 Map<String, Set<Expectation>> expectations, | 1015 Map<String, Set<Expectation>> expectations, |
| 1031 List<String> vmOptions, | 1016 List<String> vmOptions, |
| 1032 String tempDir) { | 1017 String tempDir) { |
| 1033 // TODO(Issue 14651): If we're on dartium, we need to pass [packageRoot] | |
| 1034 // on to the browser (it may be test specific). | |
| 1035 var filePath = info.filePath; | 1018 var filePath = info.filePath; |
| 1036 var fileName = filePath.toNativePath(); | 1019 var fileName = filePath.toNativePath(); |
| 1037 | 1020 |
| 1038 var optionsFromFile = info.optionsFromFile; | 1021 var optionsFromFile = info.optionsFromFile; |
| 1039 var compilationTempDir = createCompilationOutputDirectory(info.filePath); | 1022 var compilationTempDir = createCompilationOutputDirectory(info.filePath); |
| 1040 var dartWrapperFilename = '$tempDir/test.dart'; | 1023 var dartWrapperFilename = '$tempDir/test.dart'; |
| 1041 var compiledDartWrapperFilename = '$compilationTempDir/test.js'; | 1024 var compiledDartWrapperFilename = '$compilationTempDir/test.js'; |
| 1042 var dir = filePath.directoryPath; | 1025 var dir = filePath.directoryPath; |
| 1043 var nameNoExt = filePath.filenameWithoutExtension; | 1026 var nameNoExt = filePath.filenameWithoutExtension; |
| 1044 var customHtmlPath = dir.append('$nameNoExt.html').toNativePath(); | 1027 var customHtmlPath = dir.append('$nameNoExt.html').toNativePath(); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 1064 compiledDartWrapperFilename = '$tempDir/$nameNoExt.js'; | 1047 compiledDartWrapperFilename = '$tempDir/$nameNoExt.js'; |
| 1065 htmlContents = htmlContents.replaceAll( | 1048 htmlContents = htmlContents.replaceAll( |
| 1066 '%TEST_SCRIPTS%', '<script src="$nameNoExt.js"></script>'); | 1049 '%TEST_SCRIPTS%', '<script src="$nameNoExt.js"></script>'); |
| 1067 } | 1050 } |
| 1068 new File(htmlPath).writeAsStringSync(htmlContents); | 1051 new File(htmlPath).writeAsStringSync(htmlContents); |
| 1069 } else { | 1052 } else { |
| 1070 htmlPath = '$tempDir/test.html'; | 1053 htmlPath = '$tempDir/test.html'; |
| 1071 if (configuration.compiler != Compiler.dart2js && | 1054 if (configuration.compiler != Compiler.dart2js && |
| 1072 configuration.compiler != Compiler.dartdevc) { | 1055 configuration.compiler != Compiler.dartdevc) { |
| 1073 // test.dart will import the dart test. | 1056 // test.dart will import the dart test. |
| 1074 _createWrapperFile(dartWrapperFilename, filePath); | 1057 _createWrapperFile(dartWrapperFilename, filePath); |
|
Bill Hesse
2017/07/19 14:13:06
This should be dead code, and removed. We don't s
Bob Nystrom
2017/07/20 00:00:01
Done.
| |
| 1075 } else { | 1058 } else { |
| 1076 dartWrapperFilename = fileName; | 1059 dartWrapperFilename = fileName; |
| 1077 } | 1060 } |
| 1078 | 1061 |
| 1079 // Create the HTML file for the test. | 1062 // Create the HTML file for the test. |
| 1080 var scriptPath = dartWrapperFilename; | 1063 var scriptPath = dartWrapperFilename; |
| 1081 if (configuration.compiler != Compiler.none) { | 1064 if (configuration.compiler != Compiler.none) { |
|
Bill Hesse
2017/07/19 14:13:07
This should always be true
Bob Nystrom
2017/07/20 00:00:01
Done.
| |
| 1082 scriptPath = compiledDartWrapperFilename; | 1065 scriptPath = compiledDartWrapperFilename; |
| 1083 } | 1066 } |
| 1084 scriptPath = _createUrlPathFromFile(new Path(scriptPath)); | 1067 scriptPath = _createUrlPathFromFile(new Path(scriptPath)); |
| 1085 | 1068 |
| 1086 if (configuration.compiler != Compiler.dartdevc) { | 1069 if (configuration.compiler != Compiler.dartdevc) { |
| 1087 content = getHtmlContents(fileName, scriptType, scriptPath); | 1070 content = getHtmlContents(fileName, scriptType, scriptPath); |
|
Bill Hesse
2017/07/19 14:13:06
scriptType is always 'text/javascript'
Bob Nystrom
2017/07/20 00:00:01
Done.
| |
| 1088 } else { | 1071 } else { |
| 1089 var jsDir = new Path(compilationTempDir) | 1072 var jsDir = new Path(compilationTempDir) |
| 1090 .relativeTo(TestUtils.dartDir) | 1073 .relativeTo(TestUtils.dartDir) |
| 1091 .toString(); | 1074 .toString(); |
| 1092 content = dartdevcHtml(nameNoExt, jsDir, buildDir); | 1075 content = dartdevcHtml(nameNoExt, jsDir, buildDir); |
| 1093 } | 1076 } |
| 1094 | 1077 |
| 1095 new File(htmlPath).writeAsStringSync(content); | 1078 new File(htmlPath).writeAsStringSync(content); |
| 1096 } | 1079 } |
| 1097 | 1080 |
| 1098 // Construct the command(s) that compile all the inputs needed by the | 1081 // Construct the command(s) that compile all the inputs needed by the |
| 1099 // browser test. For running Dart in DRT, this will be noop commands. | 1082 // browser test. For running Dart in DRT, this will be noop commands. |
| 1100 var commands = <Command>[]; | 1083 var commands = <Command>[]; |
| 1101 | 1084 |
| 1102 switch (configuration.compiler) { | 1085 switch (configuration.compiler) { |
| 1103 case Compiler.dart2js: | 1086 case Compiler.dart2js: |
| 1104 commands.add(_dart2jsCompileCommand(dartWrapperFilename, | 1087 commands.add(_dart2jsCompileCommand(dartWrapperFilename, |
| 1105 compiledDartWrapperFilename, tempDir, optionsFromFile)); | 1088 compiledDartWrapperFilename, tempDir, optionsFromFile)); |
| 1106 break; | 1089 break; |
| 1107 | 1090 |
| 1108 case Compiler.dartdevc: | 1091 case Compiler.dartdevc: |
| 1109 var toPath = new Path('$compilationTempDir/$nameNoExt.js') | 1092 var toPath = |
| 1110 .toNativePath(); | 1093 new Path('$compilationTempDir/$nameNoExt.js').toNativePath(); |
| 1111 commands.add(configuration.compilerConfiguration.createCommand( | 1094 commands.add(configuration.compilerConfiguration |
| 1112 dartWrapperFilename, toPath)); | 1095 .createCommand(dartWrapperFilename, toPath)); |
| 1113 break; | 1096 break; |
| 1114 | 1097 |
| 1115 case Compiler.none: | 1098 case Compiler.none: |
| 1116 break; | 1099 break; |
|
Bill Hesse
2017/07/19 14:13:07
Remove this case.
Bob Nystrom
2017/07/20 00:00:00
Done.
| |
| 1117 | 1100 |
| 1118 default: | 1101 default: |
| 1119 assert(false); | 1102 assert(false); |
| 1120 } | 1103 } |
| 1121 | 1104 |
| 1122 // Some tests require compiling multiple input scripts. | 1105 // Some tests require compiling multiple input scripts. |
| 1123 for (var name in optionsFromFile['otherScripts'] as List<String>) { | 1106 for (var name in optionsFromFile['otherScripts'] as List<String>) { |
| 1124 var namePath = new Path(name); | 1107 var namePath = new Path(name); |
| 1125 var fromPath = filePath.directoryPath.join(namePath); | 1108 var fromPath = filePath.directoryPath.join(namePath); |
| 1126 var toPath = new Path('$tempDir/${namePath.filename}.js').toNativePath(); | 1109 var toPath = new Path('$tempDir/${namePath.filename}.js').toNativePath(); |
| 1127 | 1110 |
| 1128 switch (configuration.compiler) { | 1111 switch (configuration.compiler) { |
| 1129 case Compiler.dart2js: | 1112 case Compiler.dart2js: |
| 1130 commands.add(_dart2jsCompileCommand(fromPath.toNativePath(), | 1113 commands.add(_dart2jsCompileCommand( |
| 1131 toPath, tempDir, optionsFromFile)); | 1114 fromPath.toNativePath(), toPath, tempDir, optionsFromFile)); |
| 1132 break; | 1115 break; |
| 1133 | 1116 |
| 1134 case Compiler.dartdevc: | 1117 case Compiler.dartdevc: |
| 1135 commands.add(configuration.compilerConfiguration.createCommand( | 1118 commands.add(configuration.compilerConfiguration |
| 1136 fromPath.toNativePath(), toPath)); | 1119 .createCommand(fromPath.toNativePath(), toPath)); |
| 1137 break; | 1120 break; |
| 1138 | 1121 |
| 1139 default: | 1122 default: |
|
Bill Hesse
2017/07/19 14:13:06
Remove.
Bob Nystrom
2017/07/20 00:00:01
Done.
| |
| 1140 assert(configuration.compiler == Compiler.none); | 1123 assert(configuration.compiler == Compiler.none); |
| 1141 } | 1124 } |
| 1142 | 1125 |
| 1143 if (configuration.compiler == Compiler.none) { | 1126 if (configuration.compiler == Compiler.none) { |
|
Bill Hesse
2017/07/19 14:13:07
Remove.
Bob Nystrom
2017/07/20 00:00:01
Done.
| |
| 1144 // For the tests that require multiple input scripts but are not | 1127 // For the tests that require multiple input scripts but are not |
| 1145 // compiled, move the input scripts over with the script so they can | 1128 // compiled, move the input scripts over with the script so they can |
| 1146 // be accessed. | 1129 // be accessed. |
| 1147 new File(fromPath.toNativePath()) | 1130 new File(fromPath.toNativePath()) |
| 1148 .copySync('$tempDir/${namePath.filename}'); | 1131 .copySync('$tempDir/${namePath.filename}'); |
| 1149 } | 1132 } |
| 1150 } | 1133 } |
| 1151 | 1134 |
| 1152 if (info.optionsFromFile['isMultiHtmlTest'] as bool) { | 1135 if (info.optionsFromFile['isMultiHtmlTest'] as bool) { |
| 1153 // Variables for browser multi-tests. | 1136 // Variables for browser multi-tests. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1186 // Chrome may send a termination signal to a test. The test will be | 1169 // Chrome may send a termination signal to a test. The test will be |
| 1187 // terminated if a machine (bot) doesn't have a GPU or if a test is | 1170 // terminated if a machine (bot) doesn't have a GPU or if a test is |
| 1188 // still running after a certain period of time. | 1171 // still running after a certain period of time. |
| 1189 if (configuration.system == System.linux && | 1172 if (configuration.system == System.linux && |
| 1190 configuration.runtime == Runtime.drt) { | 1173 configuration.runtime == Runtime.drt) { |
| 1191 contentShellOptions.add('--disable-gpu'); | 1174 contentShellOptions.add('--disable-gpu'); |
| 1192 // TODO(terry): Roll 50 need this in conjection with disable-gpu. | 1175 // TODO(terry): Roll 50 need this in conjection with disable-gpu. |
| 1193 contentShellOptions.add('--disable-gpu-early-init'); | 1176 contentShellOptions.add('--disable-gpu-early-init'); |
| 1194 } | 1177 } |
| 1195 | 1178 |
| 1196 if (configuration.compiler == Compiler.none) { | 1179 if (configuration.compiler == Compiler.none) { |
|
Bill Hesse
2017/07/19 14:13:07
Remove.
Bob Nystrom
2017/07/20 00:00:00
Done.
| |
| 1197 dartFlags.add('--ignore-unrecognized-flags'); | 1180 dartFlags.add('--ignore-unrecognized-flags'); |
| 1198 if (configuration.isChecked) { | 1181 if (configuration.isChecked) { |
| 1199 dartFlags.add('--enable_asserts'); | 1182 dartFlags.add('--enable_asserts'); |
| 1200 dartFlags.add("--enable_type_checks"); | 1183 dartFlags.add("--enable_type_checks"); |
| 1201 } | 1184 } |
| 1202 dartFlags.addAll(vmOptions); | 1185 dartFlags.addAll(vmOptions); |
| 1203 } | 1186 } |
| 1204 | 1187 |
| 1205 commands.add(Command.contentShell(contentShellFilename, fullHtmlPath, | 1188 commands.add(Command.contentShell(contentShellFilename, fullHtmlPath, |
| 1206 contentShellOptions, dartFlags, environmentOverrides)); | 1189 contentShellOptions, dartFlags, environmentOverrides)); |
| 1207 } else { | 1190 } else { |
| 1208 commands.add(Command.browserTest(fullHtmlPath, configuration, | 1191 commands.add(Command.browserTest(fullHtmlPath, configuration, |
| 1209 retry: !isNegative(info))); | 1192 retry: !isNegative(info))); |
| 1210 } | 1193 } |
| 1211 | 1194 |
| 1212 // Create BrowserTestCase and queue it. | 1195 // Create BrowserTestCase and queue it. |
| 1213 var expectation = expectations[testName]; | 1196 var expectation = expectations[testName]; |
| 1214 var testCase = new BrowserTestCase('$suiteName/$testName', commands, | 1197 var testCase = new BrowserTestCase('$suiteName/$testName', commands, |
| 1215 configuration, expectation, info, isNegative(info), fullHtmlPath); | 1198 configuration, expectation, info, isNegative(info), fullHtmlPath); |
| 1216 | 1199 |
| 1217 enqueueNewTestCase(testCase); | 1200 enqueueNewTestCase(testCase); |
| 1218 } | 1201 } |
| 1219 | 1202 |
| 1220 void _enqueueHtmlTest(HtmlTestInformation info, String testName, | 1203 void _enqueueHtmlTest(HtmlTestInformation info, String testName, |
|
Bill Hesse
2017/07/19 14:13:06
Ignore this function, since we think we want to re
Bob Nystrom
2017/07/20 00:00:01
What do you mean by "ignore"? I think we do still
| |
| 1221 Set<Expectation> expectations) { | 1204 Set<Expectation> expectations) { |
| 1222 var compiler = configuration.compiler; | 1205 var compiler = configuration.compiler; |
| 1223 var runtime = configuration.runtime; | 1206 var runtime = configuration.runtime; |
| 1224 | 1207 |
| 1225 if (compiler == Compiler.dartdevc) { | 1208 if (compiler == Compiler.dartdevc) { |
| 1226 // TODO(rnystrom): Support this for dartdevc (#29919). | 1209 // TODO(rnystrom): Support this for dartdevc (#29919). |
| 1227 print("Ignoring $testName on dartdevc since HTML tests are not " | 1210 print("Ignoring $testName on dartdevc since HTML tests are not " |
| 1228 "implemented for that compiler yet."); | 1211 "implemented for that compiler yet."); |
| 1229 return; | 1212 return; |
| 1230 } | 1213 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1318 args.add(inputFile); | 1301 args.add(inputFile); |
| 1319 | 1302 |
| 1320 var options = optionsFromFile['sharedOptions'] as List<String>; | 1303 var options = optionsFromFile['sharedOptions'] as List<String>; |
| 1321 if (options != null) args.addAll(options); | 1304 if (options != null) args.addAll(options); |
| 1322 | 1305 |
| 1323 return Command.compilation(Compiler.dart2js.name, outputFile, | 1306 return Command.compilation(Compiler.dart2js.name, outputFile, |
| 1324 dart2JsBootstrapDependencies, compilerPath, args, environmentOverrides, | 1307 dart2JsBootstrapDependencies, compilerPath, args, environmentOverrides, |
| 1325 alwaysCompile: !useSdk); | 1308 alwaysCompile: !useSdk); |
| 1326 } | 1309 } |
| 1327 | 1310 |
| 1328 String get scriptType { | 1311 String get scriptType { |
|
Bill Hesse
2017/07/19 14:13:07
This function can be replaced with 'text/javascrip
Bob Nystrom
2017/07/20 00:00:01
Done.
| |
| 1329 switch (configuration.compiler) { | 1312 switch (configuration.compiler) { |
| 1330 case Compiler.none: | 1313 case Compiler.none: |
| 1331 return 'application/dart'; | 1314 return 'application/dart'; |
| 1332 case Compiler.dart2js: | 1315 case Compiler.dart2js: |
| 1333 case Compiler.dart2analyzer: | 1316 case Compiler.dart2analyzer: |
| 1334 case Compiler.dartdevc: | 1317 case Compiler.dartdevc: |
| 1335 return 'text/javascript'; | 1318 return 'text/javascript'; |
| 1336 default: | 1319 default: |
| 1337 print('Non-web runtime, so no scriptType for: ' | 1320 print('Non-web runtime, so no scriptType for: ' |
| 1338 '${configuration.compiler.name}'); | 1321 '${configuration.compiler.name}'); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1397 return null; | 1380 return null; |
| 1398 } | 1381 } |
| 1399 } | 1382 } |
| 1400 | 1383 |
| 1401 /** | 1384 /** |
| 1402 * Special options for individual tests are currently specified in various | 1385 * Special options for individual tests are currently specified in various |
| 1403 * ways: with comments directly in test files, by using certain imports, or by | 1386 * ways: with comments directly in test files, by using certain imports, or by |
| 1404 * creating additional files in the test directories. | 1387 * creating additional files in the test directories. |
| 1405 * | 1388 * |
| 1406 * Here is a list of options that are used by 'test.dart' today: | 1389 * Here is a list of options that are used by 'test.dart' today: |
| 1407 * - Flags can be passed to the vm or dartium process that runs the test by | 1390 * - Flags can be passed to the vm process that runs the test by adding a |
| 1408 * adding a comment to the test file: | 1391 * comment to the test file: |
| 1409 * | 1392 * |
| 1410 * // VMOptions=--flag1 --flag2 | 1393 * // VMOptions=--flag1 --flag2 |
| 1411 * | 1394 * |
| 1412 * - Flags can be passed to dart2js or vm by adding a comment | 1395 * - Flags can be passed to dart2js or vm by adding a comment |
| 1413 * to the test file: | 1396 * to the test file: |
| 1414 * | 1397 * |
| 1415 * // SharedOptions=--flag1 --flag2 | 1398 * // SharedOptions=--flag1 --flag2 |
| 1416 * | 1399 * |
| 1417 * - Flags can be passed to the dart script that contains the test also | 1400 * - Flags can be passed to the dart script that contains the test also |
| 1418 * using comments, as follows: | 1401 * using comments, as follows: |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1642 Compiler.dartkp, | 1625 Compiler.dartkp, |
| 1643 Compiler.precompiler, | 1626 Compiler.precompiler, |
| 1644 Compiler.appJit | 1627 Compiler.appJit |
| 1645 ]; | 1628 ]; |
| 1646 | 1629 |
| 1647 const runtimes = const [ | 1630 const runtimes = const [ |
| 1648 Runtime.none, | 1631 Runtime.none, |
| 1649 Runtime.dartPrecompiled, | 1632 Runtime.dartPrecompiled, |
| 1650 Runtime.vm, | 1633 Runtime.vm, |
| 1651 Runtime.drt, | 1634 Runtime.drt, |
| 1652 Runtime.dartium, | 1635 Runtime.contentShellOnAndroid |
| 1653 Runtime.contentShellOnAndroid, | |
| 1654 Runtime.dartiumOnAndroid | |
| 1655 ]; | 1636 ]; |
| 1656 | 1637 |
| 1657 var needsVmOptions = compilers.contains(configuration.compiler) && | 1638 var needsVmOptions = compilers.contains(configuration.compiler) && |
| 1658 runtimes.contains(configuration.runtime); | 1639 runtimes.contains(configuration.runtime); |
| 1659 if (!needsVmOptions) return [[]]; | 1640 if (!needsVmOptions) return [[]]; |
| 1660 return optionsFromFile['vmOptions'] as List<List<String>>; | 1641 return optionsFromFile['vmOptions'] as List<List<String>>; |
| 1661 } | 1642 } |
| 1662 | 1643 |
| 1663 /** | 1644 /** |
| 1664 * Read options from a co19 test file. | 1645 * Read options from a co19 test file. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1733 testDisplayName, | 1714 testDisplayName, |
| 1734 commands, | 1715 commands, |
| 1735 configuration, | 1716 configuration, |
| 1736 expectations as Set<Expectation>, | 1717 expectations as Set<Expectation>, |
| 1737 info, | 1718 info, |
| 1738 isNegative(info), | 1719 isNegative(info), |
| 1739 relativeHtml.toNativePath())); | 1720 relativeHtml.toNativePath())); |
| 1740 } | 1721 } |
| 1741 } | 1722 } |
| 1742 } | 1723 } |
| 1743 | 1724 |
|
Bill Hesse
2017/07/19 14:13:06
I think everything after this is dead code. There
Bob Nystrom
2017/07/20 00:00:01
I believe AnalyzeLibraryTestSuite is still used fo
| |
| 1744 /// A DartcCompilationTestSuite will run dartc on all of the tests. | 1725 /// A DartcCompilationTestSuite will run dartc on all of the tests. |
| 1745 /// | 1726 /// |
| 1746 /// Usually, the result of a dartc run is determined by the output of | 1727 /// Usually, the result of a dartc run is determined by the output of |
| 1747 /// dartc in connection with annotations in the test file. | 1728 /// dartc in connection with annotations in the test file. |
| 1748 class DartcCompilationTestSuite extends StandardTestSuite { | 1729 class DartcCompilationTestSuite extends StandardTestSuite { |
| 1749 List<String> _testDirs; | 1730 List<String> _testDirs; |
| 1750 | 1731 |
| 1751 DartcCompilationTestSuite( | 1732 DartcCompilationTestSuite( |
| 1752 Configuration configuration, | 1733 Configuration configuration, |
| 1753 String suiteName, | 1734 String suiteName, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1790 | 1771 |
| 1791 bool isTestFile(String filename) { | 1772 bool isTestFile(String filename) { |
| 1792 // NOTE: We exclude tests and patch files for now. | 1773 // NOTE: We exclude tests and patch files for now. |
| 1793 return filename.endsWith(".dart") && | 1774 return filename.endsWith(".dart") && |
| 1794 !filename.endsWith("_test.dart") && | 1775 !filename.endsWith("_test.dart") && |
| 1795 !filename.contains("_internal/js_runtime/lib"); | 1776 !filename.contains("_internal/js_runtime/lib"); |
| 1796 } | 1777 } |
| 1797 | 1778 |
| 1798 bool get listRecursively => true; | 1779 bool get listRecursively => true; |
| 1799 } | 1780 } |
| OLD | NEW |