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

Unified Diff: tools/test.dart

Issue 12417004: Update the test runner to use the new dart:io API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fixes Created 7 years, 9 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/test.dart
diff --git a/tools/test.dart b/tools/test.dart
index dbd5ba87a4d359869b1e07900269ab0798fa45d5..6b1cb591d8ab9e3da9b066ad1d8dcd170c50aba8 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -1,5 +1,5 @@
#!/usr/bin/env dart
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, 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.
@@ -71,7 +71,7 @@ final TEST_SUITE_DIRECTORIES = [
];
main() {
- var startTime = new Date.now();
+ var startTime = new DateTime.now();
var optionsParser = new TestOptionsParser();
List<Map> configurations = optionsParser.parse(new Options().arguments);
if (configurations == null || configurations.length == 0) return;
@@ -105,7 +105,7 @@ main() {
['Test configurations:'] : ['Test configuration:'];
for (Map conf in configurations) {
List settings = ['compiler', 'runtime', 'mode', 'arch']
- .mappedBy((name) => conf[name]).toList();
+ .map((name) => conf[name]).toList();
if (conf['checked']) settings.add('checked');
output_words.add(settings.join('_'));
}
@@ -116,6 +116,7 @@ main() {
return TestUtils.isBrowserRuntime(config['runtime']);
});
+ List<TestingServers> servers = [];
ricow1 2013/03/13 13:38:41 how do we make sure that these are shut down?
Søren Gjesse 2013/03/13 15:17:18 It is handled in allTestsFinished().
var testSuites = new List<TestSuite>();
var maxBrowserProcesses = maxProcesses;
for (var conf in configurations) {
@@ -124,10 +125,9 @@ main() {
// The http server is available on window.location.port, and a second
// server for cross-domain tests can be found by calling
// getCrossOriginPortNumber().
- var servers = new TestingServers(new Path(TestUtils.buildDir(conf)),
- useContentSecurityPolicy);
- servers.startServers('127.0.0.1');
- conf['_servers_'] = servers;
+ servers.add(new TestingServers(new Path(TestUtils.buildDir(conf)),
+ useContentSecurityPolicy));
+ conf['_servers_'] = servers.last;
}
// There should not be more than one InternetExplorerDriver instance
@@ -203,13 +203,29 @@ main() {
}
eventListener.add(new ExitCodeSetter());
- // Start process queue.
- new ProcessQueue(maxProcesses,
- maxBrowserProcesses,
- startTime,
- testSuites,
- eventListener,
- allTestsFinished,
- verbose,
- listTests);
+ void startProcessQueue() {
+ // Start process queue.
+ new ProcessQueue(maxProcesses,
+ maxBrowserProcesses,
+ startTime,
+ testSuites,
+ eventListener,
+ allTestsFinished,
+ verbose,
+ listTests);
+ }
+
+ void startTesting(List<TestingServers> servers) {
+ // Start all the HTTP servers required before starting the process queue.
+ if (servers.isEmpty) {
+ startProcessQueue();
+ } else {
+ TestingServers server = servers.removeLast();
+ server.startServers('127.0.0.1').then((_) {
Bill Hesse 2013/03/13 12:56:41 Could this take long enough that we would prefer t
Søren Gjesse 2013/03/13 15:17:18 Changed to what kustermann@ suggested.
+ startTesting(servers);
+ });
+ }
+ }
+
+ startTesting(servers);
}

Powered by Google App Engine
This is Rietveld 408576698