Chromium Code Reviews| 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; |