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

Side by Side Diff: tests/cli_tests/interactive_debugger_tests.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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' show 5 import 'dart:async' show
6 Future, 6 Future,
7 StreamIterator; 7 StreamIterator;
8 8
9 import 'dart:convert' show 9 import 'dart:convert' show
10 LineSplitter, 10 LineSplitter,
11 UTF8; 11 UTF8;
12 12
13 import 'dart:io' show 13 import 'dart:io' show
14 Process, 14 Process,
15 ProcessSignal; 15 ProcessSignal;
16 16
17 import 'package:expect/expect.dart' show 17 import 'package:expect/expect.dart' show
18 Expect; 18 Expect;
19 19
20 import 'cli_tests.dart' show 20 import 'cli_tests.dart' show
21 CliTest, 21 CliTest,
22 thisDirectory; 22 thisDirectory;
23 23
24 import 'prompt_splitter.dart' show 24 import 'prompt_splitter.dart' show
25 PromptSplitter; 25 PromptSplitter;
26 26
27 import 'package:fletchc/src/hub/exit_codes.dart' show 27 import 'package:dartino_compiler/src/hub/exit_codes.dart' show
28 DART_VM_EXITCODE_UNCAUGHT_EXCEPTION; 28 DART_VM_EXITCODE_UNCAUGHT_EXCEPTION;
29 29
30 final List<CliTest> tests = <CliTest>[ 30 final List<CliTest> tests = <CliTest>[
31 new DebuggerInterruptTest(), 31 new DebuggerInterruptTest(),
32 new DebuggerListProcessesTest(), 32 new DebuggerListProcessesTest(),
33 new DebuggerRelativeFileReferenceTest(), 33 new DebuggerRelativeFileReferenceTest(),
34 new DebuggerStepInLoopTest(), 34 new DebuggerStepInLoopTest(),
35 new DebuggerRerunThrowingProgramTest(), 35 new DebuggerRerunThrowingProgramTest(),
36 ]; 36 ];
37 37
38 abstract class InteractiveDebuggerTest extends CliTest { 38 abstract class InteractiveDebuggerTest extends CliTest {
39 final String testFilePath; 39 final String testFilePath;
40 final String workingDirectory; 40 final String workingDirectory;
41 Process process; 41 Process process;
42 StreamIterator out; 42 StreamIterator out;
43 StreamIterator err; 43 StreamIterator err;
44 44
45 InteractiveDebuggerTest(String name) 45 InteractiveDebuggerTest(String name)
46 : super(name), 46 : super(name),
47 testFilePath = thisDirectory.resolve("$name.dart").toFilePath(); 47 testFilePath = thisDirectory.resolve("$name.dart").toFilePath();
48 48
49 Future<Null> internalRun(); 49 Future<Null> internalRun();
50 50
51 Future<Null> run() async { 51 Future<Null> run() async {
52 process = await fletch(["debug", testFilePath], 52 process = await dartino(["debug", testFilePath],
53 workingDirectory: workingDirectory); 53 workingDirectory: workingDirectory);
54 out = new StreamIterator( 54 out = new StreamIterator(
55 process.stdout.transform(UTF8.decoder).transform(new PromptSplitter())); 55 process.stdout.transform(UTF8.decoder).transform(new PromptSplitter()));
56 err = new StreamIterator( 56 err = new StreamIterator(
57 process.stderr.transform(UTF8.decoder).transform(new LineSplitter())); 57 process.stderr.transform(UTF8.decoder).transform(new LineSplitter()));
58 try { 58 try {
59 await expectPrompt("Debug header"); 59 await expectPrompt("Debug header");
60 await internalRun(); 60 await internalRun();
61 } finally { 61 } finally {
62 process.stdin.close(); 62 process.stdin.close();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 await runCommandAndExpectPrompt("lp"); 145 await runCommandAndExpectPrompt("lp");
146 await runCommandAndExpectPrompt("c"); 146 await runCommandAndExpectPrompt("c");
147 await runCommandAndExpectPrompt("lp"); 147 await runCommandAndExpectPrompt("lp");
148 await runCommandAndExpectPrompt("c"); 148 await runCommandAndExpectPrompt("c");
149 await expectExitCode(0); 149 await expectExitCode(0);
150 } 150 }
151 } 151 }
152 152
153 class DebuggerRelativeFileReferenceTest extends InteractiveDebuggerTest { 153 class DebuggerRelativeFileReferenceTest extends InteractiveDebuggerTest {
154 154
155 // Working directory that is not the fletch-root directory. 155 // Working directory that is not the dartino-root directory.
156 final String workingDirectory = "$thisDirectory/../"; 156 final String workingDirectory = "$thisDirectory/../";
157 157
158 // Relative reference to the test file. 158 // Relative reference to the test file.
159 final String testFilePath = "cli_tests/debugger_relative_file_reference.dart"; 159 final String testFilePath = "cli_tests/debugger_relative_file_reference.dart";
160 160
161 DebuggerRelativeFileReferenceTest() 161 DebuggerRelativeFileReferenceTest()
162 : super("debugger_relative_file_reference"); 162 : super("debugger_relative_file_reference");
163 163
164 Future<Null> internalRun() async { 164 Future<Null> internalRun() async {
165 await runCommandAndExpectPrompt("bf $testFilePath 13"); 165 await runCommandAndExpectPrompt("bf $testFilePath 13");
(...skipping 27 matching lines...) Expand all
193 : super("debugger_rerun_throwing_program"); 193 : super("debugger_rerun_throwing_program");
194 194
195 Future<Null> internalRun() async { 195 Future<Null> internalRun() async {
196 await runCommandAndExpectPrompt("r"); // throws uncaught exception 196 await runCommandAndExpectPrompt("r"); // throws uncaught exception
197 await runCommandAndExpectPrompt("r"); // invalid command: use restart 197 await runCommandAndExpectPrompt("r"); // invalid command: use restart
198 await expectOut("### process already loaded, use 'restart' to run again"); 198 await expectOut("### process already loaded, use 'restart' to run again");
199 await quit(); 199 await quit();
200 await expectExitCode(DART_VM_EXITCODE_UNCAUGHT_EXCEPTION); 200 await expectExitCode(DART_VM_EXITCODE_UNCAUGHT_EXCEPTION);
201 } 201 }
202 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698