OLD | NEW |
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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
9 | 9 |
10 import 'configuration.dart'; | 10 import 'configuration.dart'; |
11 import 'path.dart'; | 11 import 'path.dart'; |
12 | 12 |
13 // This is the maximum time we expect stdout/stderr of subprocesses to deliver | 13 // This is the maximum time we expect stdout/stderr of subprocesses to deliver |
14 // data after we've got the exitCode. | 14 // data after we've got the exitCode. |
15 const Duration MAX_STDIO_DELAY = const Duration(seconds: 30); | 15 const Duration MAX_STDIO_DELAY = const Duration(seconds: 30); |
16 | 16 |
17 String MAX_STDIO_DELAY_PASSED_MESSAGE = | 17 String MAX_STDIO_DELAY_PASSED_MESSAGE = |
18 """Not waiting for stdout/stderr from subprocess anymore | 18 """Not waiting for stdout/stderr from subprocess anymore |
19 ($MAX_STDIO_DELAY passed). Please note that this could be an indicator | 19 ($MAX_STDIO_DELAY passed). Please note that this could be an indicator |
20 that there is a hanging process which we were unable to kill."""; | 20 that there is a hanging process which we were unable to kill."""; |
21 | 21 |
| 22 /// The names of the packages that are available for use in tests. |
| 23 const testPackages = const [ |
| 24 "async_helper", |
| 25 "collection", |
| 26 "expect", |
| 27 "js", |
| 28 "matcher", |
| 29 "meta", |
| 30 "path", |
| 31 "stack_trace", |
| 32 "unittest" |
| 33 ]; |
| 34 |
22 class DebugLogger { | 35 class DebugLogger { |
23 static IOSink _sink; | 36 static IOSink _sink; |
24 | 37 |
25 /** | 38 /** |
26 * If [path] was null, the DebugLogger will write messages to stdout. | 39 * If [path] was null, the DebugLogger will write messages to stdout. |
27 */ | 40 */ |
28 static void init(Path path, {bool append: false}) { | 41 static void init(Path path, {bool append: false}) { |
29 if (path != null) { | 42 if (path != null) { |
30 var mode = append ? FileMode.APPEND : FileMode.WRITE; | 43 var mode = append ? FileMode.APPEND : FileMode.WRITE; |
31 _sink = new File(path.toNativePath()).openWrite(mode: mode); | 44 _sink = new File(path.toNativePath()).openWrite(mode: mode); |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 } | 529 } |
517 if (path.length > WINDOWS_SHORTEN_PATH_LIMIT) { | 530 if (path.length > WINDOWS_SHORTEN_PATH_LIMIT) { |
518 ++shortNameCounter; | 531 ++shortNameCounter; |
519 var pathEnd = path.substring(path.length - WINDOWS_PATH_END_LENGTH); | 532 var pathEnd = path.substring(path.length - WINDOWS_PATH_END_LENGTH); |
520 path = "short${shortNameCounter}_$pathEnd"; | 533 path = "short${shortNameCounter}_$pathEnd"; |
521 } | 534 } |
522 } | 535 } |
523 return path; | 536 return path; |
524 } | 537 } |
525 } | 538 } |
OLD | NEW |