[folks] Add ability to run any of our tests through gdb



commit 506058011ec47ef14a03c9ce2fde35d82b7ba394
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Fri Jun 10 10:39:27 2011 -0700

    Add ability to run any of our tests through gdb
    
    Run a test through gdb with:
    
        make -C tests/<dir> <test name>.gdb

 HACKING                        |   11 +++++++++++
 check.mk                       |    6 ++++++
 tests/folks/Makefile.am        |    1 +
 tests/key-file/Makefile.am     |    1 +
 tests/libsocialweb/Makefile.am |    1 +
 tests/telepathy/Makefile.am    |    1 +
 tests/tracker/Makefile.am      |    1 +
 7 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/HACKING b/HACKING
index d2d5a8f..b25573d 100644
--- a/HACKING
+++ b/HACKING
@@ -116,3 +116,14 @@ Build health
 2.  After commits have been pushed to mainline, all buildbots must successfully
     build and pass 'make check' on their next build of Folks. It's up to the
     committer to ensure this requirement is met and make necessary changes.
+
+Debugging tests
+===============
+
+If a test ever crashes, you'll probably want to run it through gdb. The exact
+setup work for that is a bit complicated, so we've provided some convenience
+hooks for each test. Simply run:
+
+        make -C tests/<dir> <test name>.gdb
+
+Then use gdb as normal.
diff --git a/check.mk b/check.mk
new file mode 100644
index 0000000..34951c4
--- /dev/null
+++ b/check.mk
@@ -0,0 +1,6 @@
+# taken from gstreamer
+# gdb any given test by running make test.gdb
+%.gdb: %
+	$(TESTS_ENVIRONMENT) \
+	$(LIBTOOL) --mode=execute \
+	gdb $*
diff --git a/tests/folks/Makefile.am b/tests/folks/Makefile.am
index 31fa1f7..bc97b94 100644
--- a/tests/folks/Makefile.am
+++ b/tests/folks/Makefile.am
@@ -87,3 +87,4 @@ EXTRA_DIST = \
 
 -include $(top_srcdir)/git.mk
 -include $(top_srcdir)/valgrind.mk
+-include $(top_srcdir)/check.mk
diff --git a/tests/key-file/Makefile.am b/tests/key-file/Makefile.am
index 4df1f2a..65cccc7 100644
--- a/tests/key-file/Makefile.am
+++ b/tests/key-file/Makefile.am
@@ -63,3 +63,4 @@ EXTRA_DIST = \
 
 -include $(top_srcdir)/git.mk
 -include $(top_srcdir)/valgrind.mk
+-include $(top_srcdir)/check.mk
diff --git a/tests/libsocialweb/Makefile.am b/tests/libsocialweb/Makefile.am
index 2eae22b..92c87b5 100644
--- a/tests/libsocialweb/Makefile.am
+++ b/tests/libsocialweb/Makefile.am
@@ -83,3 +83,4 @@ EXTRA_DIST = \
 	$(NULL)
 
 -include $(top_srcdir)/git.mk
+-include $(top_srcdir)/check.mk
diff --git a/tests/telepathy/Makefile.am b/tests/telepathy/Makefile.am
index 4d1c562..8974265 100644
--- a/tests/telepathy/Makefile.am
+++ b/tests/telepathy/Makefile.am
@@ -97,3 +97,4 @@ EXTRA_DIST = \
 
 -include $(top_srcdir)/git.mk
 -include $(top_srcdir)/valgrind.mk
+-include $(top_srcdir)/check.mk
diff --git a/tests/tracker/Makefile.am b/tests/tracker/Makefile.am
index dba97aa..bb11fd0 100644
--- a/tests/tracker/Makefile.am
+++ b/tests/tracker/Makefile.am
@@ -421,3 +421,4 @@ EXTRA_DIST = \
 	$(NULL)
 
 -include $(top_srcdir)/git.mk
+-include $(top_srcdir)/check.mk



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