Files
sdk/tests/standalone/io/process_exit_test.dart
T
whesse@google.com db34632662 Turn on dartc testing of tests/standalone.
Fix a few remaining issues, and exclude the tests that are incompatible with dartc.

BUG=dart:5064, dart:7066

Review URL: https://codereview.chromium.org//11578007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16131 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 17:49:27 +00:00

36 lines
974 B
Dart

// Copyright (c) 2012, 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.
//
// Process test program to test process communication.
library ProcessExitTest;
import "dart:io";
import "process_test_util.dart";
testExit() {
var future = Process.start(getProcessTestFileName(),
const ["0", "0", "99", "0"]);
future.then((process) {
process.onExit = (int exitCode) {
Expect.equals(exitCode, 99);
};
process.stdout.onData = process.stdout.read;
process.stderr.onData = process.stderr.read;
});
}
testExitRun() {
Process.run(getProcessTestFileName(),
const ["0", "0", "99", "0"]).then((result) {
Expect.equals(result.exitCode, 99);
Expect.equals(result.stdout, '');
Expect.equals(result.stderr, '');
});
}
main() {
testExit();
testExitRun();
}