summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-10-21 11:44:50 +0100
committerMichael Meeks <michael.meeks@suse.com>2011-10-21 11:49:57 +0100
commit6850b0c528a7d405d81f0c1a0e95868566fd41f5 (patch)
treeddefb123fd2f273f4b66761c55bd97dd849eae83 /solenv
parente076064d50b3f1be27f691720b78d49a506b612a (diff)
more helpful error messages for debugging when a unit test fails
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/CppunitTest.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 586a2475a2af..9908b906dbcd 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -33,6 +33,8 @@
DBGSV_ERROR_OUT := shell
export DBGSV_ERROR_OUT
+UNIT_FAILED_MSG := echo; echo "Error: a unit test failed, please do one of:"; echo; echo "export DEBUGCPPUNIT=TRUE \# for exception catching"; echo "export GDBCPPUNITTRACE=gdb \# for interactive debugging"; echo "export VALGRIND=memcheck \# for memory checking" ; echo "and retry."
+
ifeq ($(strip $(DEBUGCPPUNIT)),TRUE)
gb_CppunitTest_GDBTRACE := gdb -nx --command=$(SOLARENV)/bin/gdbtrycatchtrace-stdout -return-child-result --args
else ifneq ($(strip $(GDBCPPUNITTRACE)),)
@@ -85,7 +87,7 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTTARGET)
$(call gb_Output_announce,$*,$(true),CUT,2)
$(call gb_Helper_abbreviate_dirs_native,\
mkdir -p $(dir $@) && \
- ($(gb_CppunitTest_CPPTESTCOMMAND) $(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) $(call gb_CppunitTest__make_args,$(ARGS),$(UNO_SERVICES),$(UNO_TYPES)) $(if $(gb_CppunitTest__interactive),,> $@.log 2>&1 || (cat $@.log && false))))
+ ($(gb_CppunitTest_CPPTESTCOMMAND) $(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) $(call gb_CppunitTest__make_args,$(ARGS),$(UNO_SERVICES),$(UNO_TYPES)) $(if $(gb_CppunitTest__interactive),,> $@.log 2>&1 || (cat $@.log && $(UNIT_FAILED_MSG) && false))))
define gb_CppunitTest_CppunitTest
$(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest__get_linktargetname,$(1)))