Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: tools/testing/dart/multitest.dart

Issue 19774003: Bugfix in multitest.dart: Make sure we copy imported files to the generated_tests directory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/multitest.dart
diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart
index 11e5ce160c953c63ad4ae0ad8fafaa071230ad8f..1159a8aafa64f6ed967a2ddea35d69a0f8102c8c 100644
--- a/tools/testing/dart/multitest.dart
+++ b/tools/testing/dart/multitest.dart
@@ -150,14 +150,12 @@ class _Annotation {
// Find all relative imports and copy them into the dir that contains
// the generated tests.
-Set<Path> _findAllRelativeImports(Path topLibrary) {
+Set<String> _findAllRelativeImports(Path topLibrary) {
Set<Path> toSearch = new Set<Path>.from([topLibrary]);
- Set<Path> foundImports = new Set<Path>();
+ Set<String> foundImports = new Set<String>();
Path libraryDir = topLibrary.directoryPath;
- // Matches #import( or #source( followed by " or ' followed by anything
- // except dart:, dart-ext: or /, at the beginning of a line.
RegExp relativeImportRegExp = new RegExp(
- '^#(import|source)[(]["\'](?!(dart:|dart-ext:|/))([^"\']*)["\']');
+ '^(import|part)\\s+["\'](?!(dart:|dart-ext:|package:|/))([^"\']*)["\']');
while (!toSearch.isEmpty) {
var thisPass = toSearch;
toSearch = new Set<Path>();
@@ -167,7 +165,7 @@ Set<Path> _findAllRelativeImports(Path topLibrary) {
Match match = relativeImportRegExp.firstMatch(line);
if (match != null) {
Path relativePath = new Path(match.group(3));
- if (foundImports.contains(relativePath)) {
+ if (foundImports.contains(relativePath.toString())) {
continue;
}
if (relativePath.toString().contains('..')) {
@@ -177,7 +175,7 @@ Set<Path> _findAllRelativeImports(Path topLibrary) {
print("relative paths containing .. are not allowed.");
exit(1);
}
- foundImports.add(relativePath);
+ foundImports.add(relativePath.toString());
toSearch.add(libraryDir.join(relativePath));
}
}
@@ -198,9 +196,10 @@ Future doMultitest(Path filePath, String outputDir, Path suiteDir,
assert(targetDir != null);
// Copy all the relative imports of the multitest.
- Set<Path> importsToCopy = _findAllRelativeImports(filePath);
+ Set<String> importsToCopy = _findAllRelativeImports(filePath);
List<Future> futureCopies = [];
- for (Path importPath in importsToCopy) {
+ for (String relativeImport in importsToCopy) {
+ Path importPath = new Path(relativeImport);
// Make sure the target directory exists.
Path importDir = importPath.directoryPath;
if (!importDir.isEmpty) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698