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

Unified Diff: runtime/tests/vm/dart/inline_stack_frame_test.dart

Issue 2686813006: Reapply "Use CodeSourceMap for stack traces (still JIT only)." (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/clustered_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tests/vm/dart/inline_stack_frame_test.dart
diff --git a/runtime/tests/vm/dart/inline_stack_frame_test.dart b/runtime/tests/vm/dart/inline_stack_frame_test.dart
index e5538553ebe3e2f8f6ce3af36dd3acc8e26df50e..d39795715b44d5d24392fb07d9c412b4ccb88165 100644
--- a/runtime/tests/vm/dart/inline_stack_frame_test.dart
+++ b/runtime/tests/vm/dart/inline_stack_frame_test.dart
@@ -4,8 +4,6 @@
// VMOptions=--optimization_counter_threshold=10 --no-background-compilation
-import "package:expect/expect.dart";
-
// This test tries to verify that we produce the correct stack trace when
// throwing exceptions even when functions are inlined.
// The test invokes a bunch of functions and then does a throw. There is a
@@ -26,7 +24,7 @@ class Test {
}
return "";
} catch (e, stacktrace) {
- var result = e + stacktrace.toString();
+ var result = e + "\n" + stacktrace.toString();
return result;
}
}
@@ -57,22 +55,33 @@ class Test {
}
}
+expectHasSubstring(String string, String substring) {
+ if (!string.contains(substring)) {
+ var sb = new StringBuffer();
+ sb.writeln("Expect string:");
+ sb.writeln(string);
+ sb.writeln("To have substring:");
+ sb.writeln(substring);
+ throw new Exception(sb.toString());
+ }
+}
+
main() {
var x = new Test();
var result = x.func1(100000);
- Expect.isTrue(result.contains("show me inlined functions"));
- Expect.isTrue(result.contains("Test.func1"));
- Expect.isTrue(result.contains("Test.func2"));
- Expect.isTrue(result.contains("Test.func3"));
- Expect.isTrue(result.contains("Test.func4"));
- Expect.isTrue(result.contains("Test.func"));
+ expectHasSubstring(result, "show me inlined functions");
+ expectHasSubstring(result, "Test.func1");
+ expectHasSubstring(result, "Test.func2");
+ expectHasSubstring(result, "Test.func3");
+ expectHasSubstring(result, "Test.func4");
+ expectHasSubstring(result, "Test.func5");
for (var i = 0; i <= 10; i++) {
result = x.func1(i);
}
- Expect.isTrue(result.contains("show me inlined functions"));
- Expect.isTrue(result.contains("Test.func1"));
- Expect.isTrue(result.contains("Test.func2"));
- Expect.isTrue(result.contains("Test.func3"));
- Expect.isTrue(result.contains("Test.func4"));
- Expect.isTrue(result.contains("Test.func5"));
+ expectHasSubstring(result, "show me inlined functions");
+ expectHasSubstring(result, "Test.func1");
+ expectHasSubstring(result, "Test.func2");
+ expectHasSubstring(result, "Test.func3");
+ expectHasSubstring(result, "Test.func4");
+ expectHasSubstring(result, "Test.func5");
}
« no previous file with comments | « no previous file | runtime/vm/clustered_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698