[folks] Also print a stack trace upon a failed test assertion.



commit 291584d75f98cc42d89c0cf2f96381f27bc81a38
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Wed Jan 12 15:55:57 2011 -0800

    Also print a stack trace upon a failed test assertion.

 tests/lib/test-case.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/tests/lib/test-case.vala b/tests/lib/test-case.vala
index 0ace778..ace4c8d 100644
--- a/tests/lib/test-case.vala
+++ b/tests/lib/test-case.vala
@@ -68,11 +68,20 @@ public abstract class Folks.TestCase : Object {
 		}
 
 		public void set_up (void* fixture) {
+			GLib.set_printerr_handler ((PrintFunc) this._printerr_func_stack_trace);
 			Log.set_default_handler (this._log_func_stack_trace);
 
 			this.test_case.set_up ();
 		}
 
+		private void _printerr_func_stack_trace (string? text) {
+			if (text != null)
+				stderr.printf (text);
+
+			/* Print a stack trace since we've hit some major issue */
+			GLib.on_error_stack_trace ("libtool --mode=execute gdb");
+		}
+
 		private void _log_func_stack_trace (string? log_domain,
 				LogLevelFlags log_levels,
 				string message) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]