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

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

Issue 2423593002: Add test directive to include other files used by a test in its compiled output directory. (Closed)
Patch Set: Created 4 years, 2 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 | « tests/standalone/standalone.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index cf6a1a05fbd4bae5108d92bcce161337a39810f4..09c796d1454f6d399fe7e4ab76c9feb41c75aa3c 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -1069,6 +1069,15 @@ class StandardTestSuite extends TestSuite {
path = path.join(new Path(vmOptionsVarient.toString()));
}
tempDir = createCompilationOutputDirectory(path);
+
+ List<String> otherResources = info.optionsFromFile['otherResources'];
+ for (String name in otherResources) {
+ Path namePath = new Path(name);
+ String fileName = namePath.filename;
+ Path fromPath = info.filePath.directoryPath.join(namePath);
+ new File('$tempDir/$name').parent.createSync(recursive: true);
+ new File(fromPath.toNativePath()).copySync('$tempDir/$name');
+ }
}
CommandArtifact compilationArtifact =
@@ -1673,6 +1682,7 @@ class StandardTestSuite extends TestSuite {
RegExp sharedOptionsRegExp = new RegExp(r"// SharedOptions=(.*)");
RegExp dartOptionsRegExp = new RegExp(r"// DartOptions=(.*)");
RegExp otherScriptsRegExp = new RegExp(r"// OtherScripts=(.*)");
+ RegExp otherResourcesRegExp = new RegExp(r"// OtherResources=(.*)");
RegExp packageRootRegExp = new RegExp(r"// PackageRoot=(.*)");
RegExp packagesRegExp = new RegExp(r"// Packages=(.*)");
RegExp isolateStubsRegExp = new RegExp(r"// IsolateStubs=(.*)");
@@ -1752,6 +1762,12 @@ class StandardTestSuite extends TestSuite {
otherScripts.addAll(match[1].split(' ').where((e) => e != '').toList());
}
+ List<String> otherResources = new List<String>();
+ matches = otherResourcesRegExp.allMatches(contents);
+ for (var match in matches) {
+ otherResources.addAll(match[1].split(' ').where((e) => e != '').toList());
+ }
+
bool isMultitest = multiTestRegExp.hasMatch(contents);
bool isMultiHtmlTest = multiHtmlTestRegExp.hasMatch(contents);
Match isolateMatch = isolateStubsRegExp.firstMatch(contents);
@@ -1776,6 +1792,7 @@ class StandardTestSuite extends TestSuite {
"hasRuntimeError": false,
"hasStaticWarning": false,
"otherScripts": otherScripts,
+ "otherResources": otherResources,
"isMultitest": isMultitest,
"isMultiHtmlTest": isMultiHtmlTest,
"subtestNames": subtestNames,
« no previous file with comments | « tests/standalone/standalone.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698