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

Side by Side Diff: tests/standalone/io/process_sync_script.dart

Issue 21816002: Add Process.runSync for running processe synchronously. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Combined the code from https://codereview.chromium.org/22827002/ into this change Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4 //
5 // Utility script to generate some output on stdout and stderr.
6
7 import "dart:math";
8 import "dart:io";
9
10 main() {
11 var options = new Options();
12 var blockCount = int.parse(options.arguments[0]);
13 var stdoutBlockSize = int.parse(options.arguments[1]);
14 var stderrBlockSize = int.parse(options.arguments[2]);
15 var stdoutBlock =
16 new String.fromCharCodes(new List.filled(stdoutBlockSize, 65));
17 var stderrBlock =
18 new String.fromCharCodes(new List.filled(stderrBlockSize, 66));
19 for (int i = 0; i < blockCount; i++) {
20 stdout.write(stdoutBlock);
21 stderr.write(stderrBlock);
22 }
23 exitCode = int.parse(options.arguments[3]);
Bill Hesse 2013/08/13 08:34:48 Why not call exit(exitCode) here?
Søren Gjesse 2013/08/13 13:00:43 Done.
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698