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

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

Issue 19483008: Add support for passing in vm options to the testing script. (Closed) Base URL: http://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 | « tools/testing/dart/test_options.dart ('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
===================================================================
--- tools/testing/dart/test_suite.dart (revision 25273)
+++ tools/testing/dart/test_suite.dart (working copy)
@@ -428,9 +428,11 @@
final Path dartDir;
Predicate<String> isTestFilePredicate;
final bool listRecursively;
+ final extraVmOptions;
static final RegExp multiTestRegExp = new RegExp(r"/// [0-9][0-9]:(.*)");
+
StandardTestSuite(Map configuration,
String suiteName,
Path suiteDirectory,
@@ -440,7 +442,8 @@
: super(configuration, suiteName),
dartDir = TestUtils.dartDir(),
listRecursively = recursive,
- suiteDir = TestUtils.dartDir().join(suiteDirectory);
+ suiteDir = TestUtils.dartDir().join(suiteDirectory),
+ extraVmOptions = TestUtils.getExtraVmOptions(configuration);
/**
* Creates a test suite whose file organization matches an expected structure.
@@ -736,8 +739,13 @@
assert(!vmOptionsList.isEmpty);
for (var vmOptions in vmOptionsList) {
+ var allVmOptions = vmOptions;
+ if (!extraVmOptions.isEmpty) {
+ allVmOptions = new List.from(vmOptions)..addAll(extraVmOptions);
+ }
+
doTest(new TestCase('$suiteName/$testName',
- makeCommands(info, vmOptions, commonArguments),
+ makeCommands(info, allVmOptions, commonArguments),
configuration,
completeHandler,
expectations,
@@ -1245,7 +1253,7 @@
bool isMultitest = optionsFromFile["isMultitest"];
List<String> dartOptions = optionsFromFile["dartOptions"];
- List<List<String>> vmOptionsList = getVmOptions(optionsFromFile);
+
assert(!isMultitest || dartOptions == null);
if (dartOptions == null) {
args.add(filePath.toNativePath());
@@ -1468,6 +1476,7 @@
RUNTIMES.contains(configuration['runtime']);
if (!needsVmOptions) return [[]];
final vmOptions = optionsFromFile['vmOptions'];
+
if (configuration['compiler'] != 'dart2dart') return vmOptions;
// Temporary workaround for race in test suite: tests with different
// vm options are still compiled into the same output file which
@@ -1913,6 +1922,20 @@
}
return new Path(path);
}
+
+ /**
+ * Gets extra vm options passed to the testing script.
+ */
+ static List<String> getExtraVmOptions(Map configuration) {
+ var extraVmOptions = [];
+ if (configuration['vm-options'] != null) {
+ extraVmOptions = configuration['vm-options'].split(" ");
+ extraVmOptions.removeWhere((s) => s.trim() == "");
+ }
+ return extraVmOptions;
+ }
+
+
}
class SummaryReport {
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698