| 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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 var path = info.filePath; | 1072 var path = info.filePath; |
| 1073 if (vmOptionsVarient != 0) { | 1073 if (vmOptionsVarient != 0) { |
| 1074 // Ensure a unique directory for each test case. | 1074 // Ensure a unique directory for each test case. |
| 1075 path = path.join(new Path(vmOptionsVarient.toString())); | 1075 path = path.join(new Path(vmOptionsVarient.toString())); |
| 1076 } | 1076 } |
| 1077 tempDir = createCompilationOutputDirectory(path); | 1077 tempDir = createCompilationOutputDirectory(path); |
| 1078 | 1078 |
| 1079 List<String> otherResources = info.optionsFromFile['otherResources']; | 1079 List<String> otherResources = info.optionsFromFile['otherResources']; |
| 1080 for (String name in otherResources) { | 1080 for (String name in otherResources) { |
| 1081 Path namePath = new Path(name); | 1081 Path namePath = new Path(name); |
| 1082 String fileName = namePath.filename; | |
| 1083 Path fromPath = info.filePath.directoryPath.join(namePath); | 1082 Path fromPath = info.filePath.directoryPath.join(namePath); |
| 1084 new File('$tempDir/$name').parent.createSync(recursive: true); | 1083 new File('$tempDir/$name').parent.createSync(recursive: true); |
| 1085 new File(fromPath.toNativePath()).copySync('$tempDir/$name'); | 1084 new File(fromPath.toNativePath()).copySync('$tempDir/$name'); |
| 1086 } | 1085 } |
| 1087 } | 1086 } |
| 1088 | 1087 |
| 1089 CommandArtifact compilationArtifact = | 1088 CommandArtifact compilationArtifact = |
| 1090 compilerConfiguration.computeCompilationArtifact( | 1089 compilerConfiguration.computeCompilationArtifact( |
| 1091 buildDir, | 1090 buildDir, |
| 1092 tempDir, | 1091 tempDir, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 if (fileString.startsWith(buildDir.toString())) { | 1163 if (fileString.startsWith(buildDir.toString())) { |
| 1165 var fileRelativeToBuildDir = file.relativeTo(buildDir); | 1164 var fileRelativeToBuildDir = file.relativeTo(buildDir); |
| 1166 return "/$PREFIX_BUILDDIR/$fileRelativeToBuildDir"; | 1165 return "/$PREFIX_BUILDDIR/$fileRelativeToBuildDir"; |
| 1167 } else if (fileString.startsWith(dartDir.toString())) { | 1166 } else if (fileString.startsWith(dartDir.toString())) { |
| 1168 var fileRelativeToDartDir = file.relativeTo(dartDir); | 1167 var fileRelativeToDartDir = file.relativeTo(dartDir); |
| 1169 return "/$PREFIX_DARTDIR/$fileRelativeToDartDir"; | 1168 return "/$PREFIX_DARTDIR/$fileRelativeToDartDir"; |
| 1170 } | 1169 } |
| 1171 // Unreachable | 1170 // Unreachable |
| 1172 print("Cannot create URL for path $file. Not in build or dart directory."); | 1171 print("Cannot create URL for path $file. Not in build or dart directory."); |
| 1173 exit(1); | 1172 exit(1); |
| 1173 return null; |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 Uri _getUriForBrowserTest(String pathComponent, String subtestName) { | 1176 Uri _getUriForBrowserTest(String pathComponent, String subtestName) { |
| 1177 // Note: If we run test.py with the "--list" option, no http servers | 1177 // Note: If we run test.py with the "--list" option, no http servers |
| 1178 // will be started. So we return a dummy url instead. | 1178 // will be started. So we return a dummy url instead. |
| 1179 if (configuration['list']) { | 1179 if (configuration['list']) { |
| 1180 return Uri.parse('http://listing_the_tests_only'); | 1180 return Uri.parse('http://listing_the_tests_only'); |
| 1181 } | 1181 } |
| 1182 assert(configuration.containsKey('_servers_')); | 1182 assert(configuration.containsKey('_servers_')); |
| 1183 int serverPort = configuration['_servers_'].port; | 1183 int serverPort = configuration['_servers_'].port; |
| (...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2530 } | 2530 } |
| 2531 if (path.length > WINDOWS_SHORTEN_PATH_LIMIT) { | 2531 if (path.length > WINDOWS_SHORTEN_PATH_LIMIT) { |
| 2532 ++shortNameCounter; | 2532 ++shortNameCounter; |
| 2533 var pathEnd = path.substring(path.length - WINDOWS_PATH_END_LENGTH); | 2533 var pathEnd = path.substring(path.length - WINDOWS_PATH_END_LENGTH); |
| 2534 path = "short${shortNameCounter}_$pathEnd"; | 2534 path = "short${shortNameCounter}_$pathEnd"; |
| 2535 } | 2535 } |
| 2536 } | 2536 } |
| 2537 return path; | 2537 return path; |
| 2538 } | 2538 } |
| 2539 } | 2539 } |
| OLD | NEW |