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

Unified Diff: utils/testrunner/run_pipeline.dart

Issue 11093033: Added ability to have custom test HTTP server handlers in the test directories. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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: utils/testrunner/run_pipeline.dart
===================================================================
--- utils/testrunner/run_pipeline.dart (revision 13447)
+++ utils/testrunner/run_pipeline.dart (working copy)
@@ -251,11 +251,25 @@
/** Third stage of pipeline - runs the tests. */
runTestStage(_) {
- if (config["server"]) { // Start the HTTP server.
- serverId = startProcess(config["dart"],
- [ '${config["runnerDir"]}/http_server_test_runner.dart',
- '--port=${config["port"]}',
- '--root=${config["root"]}']);
+ if (config["server"]) {
+ var serverPath = config["testfile"];
+ // Replace .dart with _server.dart to get test's server file, if any.
+ serverPath = '${serverPath.substring(0, serverPath.length-5)}_server.dart';
Siggi Cherem (dart-lang) 2012/10/10 17:51:32 nit: spaces around '-', I might prefer '.dart'.len
gram 2012/10/17 00:03:28 Done.
+ var serverFile = new File(serverPath);
+ if (!serverFile.existsSync()) {
+ // No custom server; run the default server.
+ serverPath = '${config["runnerDir"]}/http_server_runner.dart';
+ }
+ if (serverPath != null) {
+ var root = config["root"];
+ if (root == null) {
+ // Set the root to be the directory containing the test file.
+ root = getDirectory(config["testfile"]);
+ }
+ // Start the HTTP server.
+ serverId = startProcess(config["dart"],
+ [ serverPath, '--port=${config["port"]}', '--root=$root']);
+ }
}
var cmd, args;

Powered by Google App Engine
This is Rietveld 408576698