From 4f76e46290b26deeb4f9660c580a5ffef58a557e Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Sat, 14 Nov 2015 02:41:50 +0100 Subject: make CPPUNITTRACE=TRUE a shortcut for debuging on WNT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie834e1e1592163977435f0af6dde04c4fe86c1bf Reviewed-on: https://gerrit.libreoffice.org/19977 Tested-by: Jenkins Reviewed-by: jan iversen Reviewed-by: Michael Meeks Reviewed-by: Björn Michaelsen --- solenv/gbuild/CppunitTest.mk | 6 +++--- solenv/gbuild/platform/com_GCC_class.mk | 6 ++++++ solenv/gbuild/platform/com_MSC_class.mk | 4 ++++ solenv/gbuild/platform/unittest-failed-WNT.sh | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 93aa1a3465b1..b90fb7fac7e4 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -22,12 +22,12 @@ gb_CppunitTest_UNITTESTFAILED ?= $(GBUILDDIR)/platform/unittest-failed-default.sh gb_CppunitTest_PYTHONDEPS ?= $(call gb_Library_get_target,pyuno_wrapper) $(if $(SYSTEM_PYTHON),,$(call gb_Package_get_target,python3)) -ifeq ($(strip $(DEBUGCPPUNIT)),TRUE) -gb_CppunitTest_GDBTRACE := gdb -nx -ex "add-auto-load-safe-path $(INSTDIR)" --batch --command=$(SRCDIR)/solenv/bin/gdbtrycatchtrace-stdout -return-child-result --args -else ifneq ($(strip $(CPPUNITTRACE)),) +ifeq ($(strip $(gb_CppunitTest_GDBTRACE)),) +ifneq ($(strip $(CPPUNITTRACE)),) gb_CppunitTest_GDBTRACE := $(CPPUNITTRACE) gb_CppunitTest__interactive := $(true) endif +endif ifneq ($(strip $(VALGRIND)),) gb_CppunitTest_VALGRINDTOOL := valgrind --tool=$(VALGRIND) --num-callers=50 --error-exitcode=1 --trace-children=yes --trace-children-skip='*/java,*/gij' diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index 917b1557dec7..b7c1e6537184 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -190,6 +190,12 @@ $(call gb_Helper_abbreviate_dirs,\ endef +# CppunitTest class + +ifeq ($(strip $(DEBUGCPPUNIT)),TRUE) +gb_CppunitTest_GDBTRACE := gdb -nx -ex "add-auto-load-safe-path $(INSTDIR)" --batch --command=$(SRCDIR)/solenv/bin/gdbtrycatchtrace-stdout -return-child-result --args +endif + # ExternalProject class gb_ExternalProject_use_autoconf := diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 41bab51d7f21..2ed964955937 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -439,6 +439,10 @@ endef gb_PythonTest_PRECOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) gb_PythonTest_DEPS := $(call gb_Package_get_target,python3) +ifeq ($(strip $(CPPUNITTRACE)),TRUE) +gb_CppunitTest_GDBTRACE := '$(DEVENV)' /debugexe +endif + # SrsPartTarget class ifeq ($(gb_FULLDEPS),$(true)) diff --git a/solenv/gbuild/platform/unittest-failed-WNT.sh b/solenv/gbuild/platform/unittest-failed-WNT.sh index 9ac742bab65a..55b583d1108d 100755 --- a/solenv/gbuild/platform/unittest-failed-WNT.sh +++ b/solenv/gbuild/platform/unittest-failed-WNT.sh @@ -19,6 +19,7 @@ cat << EOF Error: a unit test failed, please do one of: +make $1Test_$2 CPPUNITTRACE=TRUE # which is a shortcut for the following line make $1Test_$2 CPPUNITTRACE="'$DEVENV' /debugexe" # for interactive debugging in Visual Studio make $1Test_$2 CPPUNITTRACE="drmemory -free_max_frames 20" # for memory checking (install Dr.Memory first, and put it to your PATH) -- cgit