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

Side by Side Diff: tools/testing/dart/android.dart

Issue 1940213003: Fix handling of negative exit codes in test.dart on Android. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « tests/language/language.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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 library android; 5 library android;
6 6
7 import "dart:async"; 7 import "dart:async";
8 import "dart:convert" show LineSplitter, UTF8; 8 import "dart:convert" show LineSplitter, UTF8;
9 import "dart:core"; 9 import "dart:core";
10 import "dart:collection"; 10 import "dart:collection";
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 int exitCode = result.exitCode; 326 int exitCode = result.exitCode;
327 var lines = result 327 var lines = result
328 .stdout.split('\n') 328 .stdout.split('\n')
329 .where((line) => line.trim().length > 0) 329 .where((line) => line.trim().length > 0)
330 .toList(); 330 .toList();
331 if (lines.length > 0) { 331 if (lines.length > 0) {
332 int index = lines.last.indexOf(MARKER); 332 int index = lines.last.indexOf(MARKER);
333 if (index >= 0) { 333 if (index >= 0) {
334 exitCode = int.parse( 334 exitCode = int.parse(
335 lines.last.substring(index + MARKER.length).trim()); 335 lines.last.substring(index + MARKER.length).trim());
336 exitCode = exitCode.toSigned(8);
336 } else { 337 } else {
337 // In case of timeouts, for example, we won't get the exitcode marker. 338 // In case of timeouts, for example, we won't get the exitcode marker.
338 assert(result.exitCode != 0); 339 assert(result.exitCode != 0);
339 } 340 }
340 } 341 }
341 return new AdbCommandResult( 342 return new AdbCommandResult(
342 result.command, result.stdout, result.stderr, exitCode, 343 result.command, result.stdout, result.stderr, exitCode,
343 result.timedOut); 344 result.timedOut);
344 } 345 }
345 346
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 427
427 void releaseDevice(AdbDevice device) { 428 void releaseDevice(AdbDevice device) {
428 if (_waiter.length > 0) { 429 if (_waiter.length > 0) {
429 Completer completer = _waiter.removeFirst(); 430 Completer completer = _waiter.removeFirst();
430 completer.complete(device); 431 completer.complete(device);
431 } else { 432 } else {
432 _idleDevices.add(device); 433 _idleDevices.add(device);
433 } 434 }
434 } 435 }
435 } 436 }
OLDNEW
« no previous file with comments | « tests/language/language.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698