| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 /// Modify this file to include more tests. | 5 /// Modify this file to include more tests. |
| 6 library dartino_tests.debugger; | 6 library dartino_tests.debugger; |
| 7 | 7 |
| 8 import 'dart:async' show | 8 import 'dart:async' show |
| 9 Stream, | 9 Stream, |
| 10 Future; | 10 Future; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 testDebugCommandStream(DartinoVmContext context) async* { | 107 testDebugCommandStream(DartinoVmContext context) async* { |
| 108 yield 't verbose'; | 108 yield 't verbose'; |
| 109 yield 'b main'; | 109 yield 'b main'; |
| 110 yield 'r'; | 110 yield 'r'; |
| 111 while (!context.terminated) { | 111 while (!context.terminated) { |
| 112 yield 's'; | 112 yield 's'; |
| 113 } | 113 } |
| 114 yield 'q'; |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 int result = await new CommandLineDebugger( | 117 int result = await new CommandLineDebugger( |
| 117 state.vmContext, | 118 state.vmContext, |
| 118 debuggerCommands.isEmpty | 119 debuggerCommands.isEmpty |
| 119 ? testDebugCommandStream(state.vmContext) | 120 ? testDebugCommandStream(state.vmContext) |
| 120 : new Stream.fromIterable(debuggerCommands), | 121 : new Stream.fromIterable(debuggerCommands), |
| 121 Uri.base, | 122 Uri.base, |
| 122 state.stdoutSink, | 123 state.stdoutSink, |
| 123 echo: true).run(state, snapshotLocation: snapshotPath); | 124 echo: true).run(state, snapshotLocation: snapshotPath); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return listTestsInternal(false); | 205 return listTestsInternal(false); |
| 205 } | 206 } |
| 206 | 207 |
| 207 main(List<String> args) async { | 208 main(List<String> args) async { |
| 208 args = args.map((a) => 'debugger/$a').toList(); | 209 args = args.map((a) => 'debugger/$a').toList(); |
| 209 Map<String, NoArgFuture> tests = await listTestsInternal(true); | 210 Map<String, NoArgFuture> tests = await listTestsInternal(true); |
| 210 for (String name in tests.keys) { | 211 for (String name in tests.keys) { |
| 211 if (args.isEmpty || args.contains(name)) await tests[name](); | 212 if (args.isEmpty || args.contains(name)) await tests[name](); |
| 212 } | 213 } |
| 213 } | 214 } |
| OLD | NEW |