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

Unified Diff: pkg/scheduled_test/test/metatest.dart

Issue 12377093: Add a ScheduledProcess class to pkg/scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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: pkg/scheduled_test/test/metatest.dart
diff --git a/pkg/scheduled_test/test/metatest.dart b/pkg/scheduled_test/test/metatest.dart
index 9850ffff41e4f5df44948a5f9ad7355a45ab35b5..636c7e7c5e78c499c2f0bd7feaea620f58713b56 100644
--- a/pkg/scheduled_test/test/metatest.dart
+++ b/pkg/scheduled_test/test/metatest.dart
@@ -17,6 +17,11 @@ import 'package:unittest/unittest.dart';
import 'utils.dart';
+// TODO(nweiz): get rid of this once issue 8863 is fixed.
+/// The path to the Dart executable. This is only set in a child isolate.
+String get dartExecutable => _executable;
+String _executable;
+
/// Declares a test with the given [description] and [body]. [body] corresponds
/// to the `main` method of a test file, and will be run in an isolate. By
/// default, this expects that all tests defined in [body] pass, but if
@@ -99,7 +104,8 @@ Future<bool> get _inChildIsolate {
var completer = new Completer();
port.receive((message, replyTo) {
- _testToRun = message;
+ _testToRun = message['testToRun'];
+ _executable = message['executable'];
_replyTo = replyTo;
port.close();
completer.complete(true);
@@ -117,8 +123,10 @@ Future<bool> get _inChildIsolate {
/// describing the results of that test run.
Future<Map> _runInIsolate(String description) {
// TODO(nweiz): Don't use path here once issue 8440 is fixed.
- var future = spawnUri(path.join(path.current, new Options().script))
- .call(description);
+ var future = spawnUri(path.join(path.current, new Options().script)).call({
+ 'testToRun': description,
+ 'executable': new Options().executable
+ });
// TODO(nweiz): Remove this timeout once issue 8417 is fixed and we can
// capture top-level exceptions.
return timeout(future, 30 * 1000, () {

Powered by Google App Engine
This is Rietveld 408576698