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

Unified Diff: tests/standalone/debugger/basic_debugger_test.dart

Issue 11576053: Add basic standalone debugger test (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/debugger/debug_lib.dart » ('j') | tests/standalone/debugger/debug_lib.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/debugger/basic_debugger_test.dart
===================================================================
--- tests/standalone/debugger/basic_debugger_test.dart (revision 0)
+++ tests/standalone/debugger/basic_debugger_test.dart (revision 0)
@@ -0,0 +1,43 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This test forks a second vm process that runs this dart script as
+// a debug target.
+// Run this test with option --wire to see the json messages sent
+// between the processes.
+// Run this test with option --verbose to see the stdout and stderr output
+// of the debug target process.
+
+import "debug_lib.dart";
+
+bar(x) {
+ print(x);
+}
+
+foo(i) {
+ bar("baz");
+ print(i);
+}
+
+main() {
+ if (RunScript(testScript)) return;
+ print("Hello from debuggee");
+ foo(42);
+ print("Hello again");
+}
+
+
+// Expected debugger events and commands.
+var testScript = [
+ Breakpoint(), // Expect a breakpoint event.
+ MatchFrame(0, "main"), // Top frame in trace is function "main".
+ Step(),
+ Breakpoint(function: "main"),
+ SetBreakpoint(8), // Set breakpoint a line 15, in function bar.
+ Resume(),
+ Breakpoint(function: "bar"),
+ MatchFrames(["bar", "foo", "main"]),
+ MatchFrame(1, "foo"),
+ Resume(),
+];
« no previous file with comments | « no previous file | tests/standalone/debugger/debug_lib.dart » ('j') | tests/standalone/debugger/debug_lib.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698