Add ability to run any of our tests through gdb
authorTravis Reitter <travis.reitter@collabora.co.uk>
Fri, 10 Jun 2011 17:39:27 +0000 (10:39 -0700)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Tue, 21 Jun 2011 21:07:11 +0000 (14:07 -0700)
Run a test through gdb with:

    make -C tests/<dir> <test name>.gdb

HACKING
check.mk [new file with mode: 0644]
tests/folks/Makefile.am
tests/key-file/Makefile.am
tests/libsocialweb/Makefile.am
tests/telepathy/Makefile.am
tests/tracker/Makefile.am

diff --git a/HACKING b/HACKING
index d2d5a8f..b25573d 100644 (file)
--- 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 (file)
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 $*
index 31fa1f7..bc97b94 100644 (file)
@@ -87,3 +87,4 @@ EXTRA_DIST = \
 
 -include $(top_srcdir)/git.mk
 -include $(top_srcdir)/valgrind.mk
+-include $(top_srcdir)/check.mk
index 4df1f2a..65cccc7 100644 (file)
@@ -63,3 +63,4 @@ EXTRA_DIST = \
 
 -include $(top_srcdir)/git.mk
 -include $(top_srcdir)/valgrind.mk
+-include $(top_srcdir)/check.mk
index 2eae22b..92c87b5 100644 (file)
@@ -83,3 +83,4 @@ EXTRA_DIST = \
        $(NULL)
 
 -include $(top_srcdir)/git.mk
+-include $(top_srcdir)/check.mk
index 4d1c562..8974265 100644 (file)
@@ -97,3 +97,4 @@ EXTRA_DIST = \
 
 -include $(top_srcdir)/git.mk
 -include $(top_srcdir)/valgrind.mk
+-include $(top_srcdir)/check.mk
index dba97aa..bb11fd0 100644 (file)
@@ -421,3 +421,4 @@ EXTRA_DIST = \
        $(NULL)
 
 -include $(top_srcdir)/git.mk
+-include $(top_srcdir)/check.mk