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

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

Issue 10973009: Create a wrapper around test.dart for running co19 tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 | dart/tools/testing/dart/test_runner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/testing/dart/co19_test.dart
diff --git a/dart/tools/testing/dart/co19_test.dart b/dart/tools/testing/dart/co19_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c9b96a5ff82ae15649a3cfe7ac622f58a050434f
--- /dev/null
+++ b/dart/tools/testing/dart/co19_test.dart
@@ -0,0 +1,88 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Tool for running co19 tests. Used when updating co19.
+ *
+ * Currently, this tool is merely a convenience around multiple
+ * invocations of test.dart. Long term, we hope to evolve this into a
+ * script that can automate most of the tasks necessary when updating
+ * co19.
+ *
+ * Usage:
+ * [: ./tools/testing/bin/$OS/dart tools/testing/dart/co19_test.dart :]
+ */
+
+#library("co19_test");
+
+#import("dart:io");
+#import("test_runner.dart");
+#import("test_options.dart");
+#import("test_suite.dart");
+#import("test_progress.dart");
+
+#import("../../../tests/co19/test_config.dart");
+
+const List<String> COMMON_ARGUMENTS =
+ const <String>['--report', '-pcolor', '--time'];
+
+const List<List<String>> COMMAND_LINES = const <List<String>>[
+ const <String>['-mrelease,debug', '-rvm', '-cnone'],
+ const <String>['-mrelease,debug', '-rvm', '-cnone', '--checked'],
+ const <String>['-mrelease', '-rnone', '-cdartc'],
+ const <String>['-mrelease', '-rd8', '-cdart2js'],
+ const <String>['-mrelease', '-rd8', '-cdart2js', '--checked']];
+
+void main() {
+ File scriptFile = new File(new Options().script);
+ Path scriptPath =
+ new Path.fromNative(scriptFile.fullPathSync())
+ .directoryPath.directoryPath.directoryPath.append('test.dart');
+ TestUtils.testScriptPath = scriptPath.toNativePath();
+ var startTime = new Date.now();
+ var optionsParser = new TestOptionsParser();
+ List<Map> configurations = <Map>[];
+ for (var commandLine in COMMAND_LINES) {
+ List arguments = <String>[];
+ arguments.addAll(COMMON_ARGUMENTS);
+ arguments.addAll(commandLine);
+ arguments.add('co19');
+ configurations.addAll(optionsParser.parse(arguments));
+ }
+ if (configurations == null || configurations.isEmpty()) return;
+
+ var firstConfiguration = configurations[0];
+ Map<String, RegExp> selectors = firstConfiguration['selectors'];
+ var maxProcesses = firstConfiguration['tasks'];
+ var progressIndicator = firstConfiguration['progress'];
+ var printTiming = firstConfiguration['time'];
+ var verbose = firstConfiguration['verbose'];
+ var listTests = firstConfiguration['list'];
+
+ var configurationIterator = configurations.iterator();
+ bool enqueueConfiguration(ProcessQueue queue) {
+ if (!configurationIterator.hasNext()) {
+ return false;
+ }
+
+ var configuration = configurationIterator.next();
+ for (String selector in selectors.getKeys()) {
+ if (selector == 'co19') {
+ queue.addTestSuite(new Co19TestSuite(configuration));
+ } else {
+ throw 'Error: unexpected selector: "$selector".';
+ }
+ }
+ return true;
+ }
+
+ // Start process queue.
+ var queue = new ProcessQueue(maxProcesses,
+ progressIndicator,
+ startTime,
+ printTiming,
+ enqueueConfiguration,
+ verbose,
+ listTests);
+}
« no previous file with comments | « no previous file | dart/tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698