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

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

Issue 48323003: Implement fromEnvironment on bool, int, String in dart2js. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
Index: tools/testing/dart/test_suite.dart
===================================================================
--- tools/testing/dart/test_suite.dart (revision 29517)
+++ tools/testing/dart/test_suite.dart (working copy)
@@ -767,10 +767,14 @@
List<Command> makeCommands(TestInformation info, var vmOptions, var args) {
var compiler = configuration['compiler'];
+ List<String> sharedOptions = info.optionsFromFile['sharedOptions'];
switch (compiler) {
case 'dart2js':
args = new List.from(args);
String tempDir = createCompilationOutputDirectory(info.filePath);
+ if (sharedOptions != null) {
+ args.addAll(sharedOptions);
+ }
kustermann 2013/10/30 13:49:07 If you do it here, do it for dart2dart below as we
ngeoffray 2013/10/30 14:39:48 Done.
args.add('--out=$tempDir/out.js');
var command = CommandBuilder.instance.getCompilationCommand(
@@ -817,6 +821,9 @@
case 'none':
var arguments = new List.from(vmOptions);
+ if (sharedOptions != null) {
+ arguments.addAll(sharedOptions);
+ }
kustermann 2013/10/30 13:49:07 There have to be other places where we setup the o
ngeoffray 2013/10/30 14:39:48 As discussed, we don't want to test this in drt/da
arguments.addAll(args);
return <Command>[CommandBuilder.instance.getVmCommand(
dartShellFileName, arguments, configurationDir)];
@@ -1406,6 +1413,7 @@
return readOptionsFromCo19File(filePath);
}
RegExp testOptionsRegExp = new RegExp(r"// VMOptions=(.*)");
+ RegExp sharedOptionsRegExp = new RegExp(r"// SharedOptions=(.*)");
RegExp dartOptionsRegExp = new RegExp(r"// DartOptions=(.*)");
RegExp otherScriptsRegExp = new RegExp(r"// OtherScripts=(.*)");
RegExp packageRootRegExp = new RegExp(r"// PackageRoot=(.*)");
@@ -1424,6 +1432,7 @@
// Find the options in the file.
List<List> result = new List<List>();
List<String> dartOptions;
+ List<String> sharedOptions;
String packageRoot;
Iterable<Match> matches = testOptionsRegExp.allMatches(contents);
@@ -1441,6 +1450,15 @@
dartOptions = match[1].split(' ').where((e) => e != '').toList();
}
+ matches = sharedOptionsRegExp.allMatches(contents);
+ for (var match in matches) {
+ if (sharedOptions != null) {
+ throw new Exception(
+ 'More than one "// DartOptions=" line in test $filePath');
kustermann 2013/10/30 13:49:07 DartOptions => SharedOptions
ricow1 2013/10/30 13:51:19 DartOptions -> SharedOptions
+ }
+ sharedOptions = match[1].split(' ').where((e) => e != '').toList();
+ }
+
matches = packageRootRegExp.allMatches(contents);
for (var match in matches) {
if (packageRoot != null) {
@@ -1481,6 +1499,7 @@
}
return { "vmOptions": result,
+ "sharedOptions": sharedOptions,
"dartOptions": dartOptions,
"packageRoot": packageRoot,
"hasCompileError": false,
@@ -1549,6 +1568,7 @@
return {
"vmOptions": <List>[[]],
+ "sharedOptions": null,
"dartOptions": null,
"packageRoot": null,
"hasCompileError": hasCompileError,

Powered by Google App Engine
This is Rietveld 408576698