| 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 // This test forks a second vm process that runs a dart script as | 5 // This test forks a second vm process that runs a dart script as |
| 6 // a debug target, single stepping through the entire program, and | 6 // a debug target, single stepping through the entire program, and |
| 7 // recording each breakpoint. At the end, a coverage map of the source | 7 // recording each breakpoint. At the end, a coverage map of the source |
| 8 // is printed. | 8 // is printed. |
| 9 // | 9 // |
| 10 // Usage: dart coverage.dart [--wire] [--verbose] target_script.dart | 10 // Usage: dart coverage.dart [--wire] [--verbose] target_script.dart |
| 11 // | 11 // |
| 12 // --wire see json messages sent between the processes. | 12 // --wire see json messages sent between the processes. |
| 13 // --verbose see the stdout and stderr output of the debug | 13 // --verbose see the stdout and stderr output of the debug |
| 14 // target process. | 14 // target process. |
| 15 | 15 |
| 16 import "dart:convert"; | 16 import "dart:convert"; |
| 17 import "dart:io"; | 17 import "dart:io"; |
| 18 import "dart:utf"; | |
| 19 import "dart:json" as JSON; | 18 import "dart:json" as JSON; |
| 20 | 19 |
| 21 | 20 |
| 22 // Whether or not to print debug target process on the console. | 21 // Whether or not to print debug target process on the console. |
| 23 var showDebuggeeOutput = false; | 22 var showDebuggeeOutput = false; |
| 24 | 23 |
| 25 // Whether or not to print the debugger wire messages on the console. | 24 // Whether or not to print the debugger wire messages on the console. |
| 26 var verboseWire = false; | 25 var verboseWire = false; |
| 27 | 26 |
| 28 var debugger = null; | 27 var debugger = null; |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 targetOpts.add(str); | 539 targetOpts.add(str); |
| 541 break; | 540 break; |
| 542 } | 541 } |
| 543 } | 542 } |
| 544 | 543 |
| 545 Process.start(options.executable, targetOpts).then((Process process) { | 544 Process.start(options.executable, targetOpts).then((Process process) { |
| 546 process.stdin.close(); | 545 process.stdin.close(); |
| 547 debugger = new Debugger(process); | 546 debugger = new Debugger(process); |
| 548 }); | 547 }); |
| 549 } | 548 } |
| OLD | NEW |