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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 // browser test. For running Dart in DRT, this will be noop commands. | 1039 // browser test. For running Dart in DRT, this will be noop commands. |
1040 var commands = <Command>[]; | 1040 var commands = <Command>[]; |
1041 | 1041 |
1042 switch (configuration.compiler) { | 1042 switch (configuration.compiler) { |
1043 case Compiler.dart2js: | 1043 case Compiler.dart2js: |
1044 commands.add(_dart2jsCompileCommand( | 1044 commands.add(_dart2jsCompileCommand( |
1045 fileName, jsWrapperFileName, tempDir, optionsFromFile)); | 1045 fileName, jsWrapperFileName, tempDir, optionsFromFile)); |
1046 break; | 1046 break; |
1047 | 1047 |
1048 case Compiler.dartdevc: | 1048 case Compiler.dartdevc: |
1049 var toPath = new Path('$compilationTempDir/$nameNoExt.js') | 1049 var toPath = |
1050 .toNativePath(); | 1050 new Path('$compilationTempDir/$nameNoExt.js').toNativePath(); |
1051 commands.add(configuration.compilerConfiguration.createCommand( | 1051 commands.add(configuration.compilerConfiguration.createCommand(fileName, |
1052 dartWrapperFilename, toPath, | 1052 toPath, optionsFromFile["sharedOptions"] as List<String>)); |
1053 optionsFromFile["sharedOptions"] as List<String>)); | |
1054 break; | 1053 break; |
1055 | 1054 |
1056 default: | 1055 default: |
1057 assert(false); | 1056 assert(false); |
1058 } | 1057 } |
1059 | 1058 |
1060 // Some tests require compiling multiple input scripts. | 1059 // Some tests require compiling multiple input scripts. |
1061 for (var name in optionsFromFile['otherScripts'] as List<String>) { | 1060 for (var name in optionsFromFile['otherScripts'] as List<String>) { |
1062 var namePath = new Path(name); | 1061 var namePath = new Path(name); |
1063 var fromPath = info.filePath.directoryPath.join(namePath); | 1062 var fromPath = info.filePath.directoryPath.join(namePath); |
1064 var toPath = new Path('$tempDir/${namePath.filename}.js').toNativePath(); | 1063 var toPath = new Path('$tempDir/${namePath.filename}.js').toNativePath(); |
1065 | 1064 |
1066 switch (configuration.compiler) { | 1065 switch (configuration.compiler) { |
1067 case Compiler.dart2js: | 1066 case Compiler.dart2js: |
1068 commands.add(_dart2jsCompileCommand( | 1067 commands.add(_dart2jsCompileCommand( |
1069 fromPath.toNativePath(), toPath, tempDir, optionsFromFile)); | 1068 fromPath.toNativePath(), toPath, tempDir, optionsFromFile)); |
1070 break; | 1069 break; |
1071 | 1070 |
1072 case Compiler.dartdevc: | 1071 case Compiler.dartdevc: |
1073 commands.add(configuration.compilerConfiguration.createCommand( | 1072 commands.add(configuration.compilerConfiguration.createCommand( |
1074 fromPath.toNativePath(), toPath, | 1073 fromPath.toNativePath(), |
| 1074 toPath, |
1075 optionsFromFile["sharedOptions"] as List<String>)); | 1075 optionsFromFile["sharedOptions"] as List<String>)); |
1076 break; | 1076 break; |
1077 } | 1077 } |
1078 } | 1078 } |
1079 | 1079 |
1080 if (info.optionsFromFile['isMultiHtmlTest'] as bool) { | 1080 if (info.optionsFromFile['isMultiHtmlTest'] as bool) { |
1081 // Variables for browser multi-tests. | 1081 // Variables for browser multi-tests. |
1082 var subtestNames = info.optionsFromFile['subtestNames'] as List<String>; | 1082 var subtestNames = info.optionsFromFile['subtestNames'] as List<String>; |
1083 for (var subtestName in subtestNames) { | 1083 for (var subtestName in subtestNames) { |
1084 _enqueueSingleBrowserTest(commands, info, '$testName/$subtestName', | 1084 _enqueueSingleBrowserTest(commands, info, '$testName/$subtestName', |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 | 1693 |
1694 bool isTestFile(String filename) { | 1694 bool isTestFile(String filename) { |
1695 // NOTE: We exclude tests and patch files for now. | 1695 // NOTE: We exclude tests and patch files for now. |
1696 return filename.endsWith(".dart") && | 1696 return filename.endsWith(".dart") && |
1697 !filename.endsWith("_test.dart") && | 1697 !filename.endsWith("_test.dart") && |
1698 !filename.contains("_internal/js_runtime/lib"); | 1698 !filename.contains("_internal/js_runtime/lib"); |
1699 } | 1699 } |
1700 | 1700 |
1701 bool get listRecursively => true; | 1701 bool get listRecursively => true; |
1702 } | 1702 } |
OLD | NEW |