OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** The default pipeline code for running a test file. */ | 5 /** The default pipeline code for running a test file. */ |
6 library pipeline; | 6 library pipeline; |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
10 import 'dart:math'; | 10 import 'dart:math'; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 /** Pipeline output. */ | 54 /** Pipeline output. */ |
55 List stdout; | 55 List stdout; |
56 | 56 |
57 /** Pipeline errors. */ | 57 /** Pipeline errors. */ |
58 List stderr; | 58 List stderr; |
59 | 59 |
60 /** Directory where test wrappers are created. */ | 60 /** Directory where test wrappers are created. */ |
61 String tmpDir; | 61 String tmpDir; |
62 | 62 |
63 void main() { | 63 void main(List<String> args, SendPort replyTo) { |
64 port.receive((cfg, replyPort) { | 64 var port = new ReceivePort(); |
65 config = cfg; | 65 replyTo.send(port); |
| 66 port.first.then((message) { |
| 67 config = message[0]; |
| 68 var replyPort = message[1]; |
66 stdout = new List(); | 69 stdout = new List(); |
67 stderr = new List(); | 70 stderr = new List(); |
68 initPipeline(replyPort); | 71 initPipeline(replyPort); |
69 startHTTPServerStage(); | 72 startHTTPServerStage(); |
70 }); | 73 }); |
71 } | 74 } |
72 | 75 |
73 /** Initial pipeline stage - starts the HTTP server, if appropriate. */ | 76 /** Initial pipeline stage - starts the HTTP server, if appropriate. */ |
74 startHTTPServerStage() { | 77 startHTTPServerStage() { |
75 if (config["server"]) { | 78 if (config["server"]) { |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 cleanup(tempHtmlFile); | 361 cleanup(tempHtmlFile); |
359 cleanup(tempJsFile); | 362 cleanup(tempJsFile); |
360 cleanup(tempChildDartFile); | 363 cleanup(tempChildDartFile); |
361 cleanup(tempChildJsFile); | 364 cleanup(tempChildJsFile); |
362 cleanup(createTempName(tmpDir, "pubspec", "yaml")); | 365 cleanup(createTempName(tmpDir, "pubspec", "yaml")); |
363 cleanup(createTempName(tmpDir, "pubspec", "lock")); | 366 cleanup(createTempName(tmpDir, "pubspec", "lock")); |
364 cleanupDir(createTempName(tmpDir, "packages")); | 367 cleanupDir(createTempName(tmpDir, "packages")); |
365 } | 368 } |
366 completePipeline(stdout, stderr, exitcode); | 369 completePipeline(stdout, stderr, exitcode); |
367 } | 370 } |
OLD | NEW |