[Libreoffice-commits] core.git: solenv/gbuild

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 24 13:17:28 UTC 2020


 solenv/gbuild/CppunitTest.mk            |    4 ++--
 solenv/gbuild/platform/com_GCC_class.mk |    8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 9ad61fe99f02e0da7333e7b81834a96983ad48c2
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Sep 24 10:53:30 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Sep 24 15:16:43 2020 +0200

    Implement DEBUGCPPUNIT as a special case of CPPUNITTRACE
    
    ...so that gb_CppunitTest_GDBTRACE is only defined in a single place now (in
    solenv/gbuild/CppunitTest.mk), which should make reasoning about the code
    simpler
    
    Change-Id: I275a20c2fe473e68f4bb08a3fe2691a5809f91a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103298
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 612a89286935..356b4317ab4f 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -22,12 +22,11 @@
 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 $(gb_CppunitTest_GDBTRACE)),)
 ifneq ($(strip $(CPPUNITTRACE)),)
 ifneq ($(filter gdb,$(CPPUNITTRACE)),)
 # sneak (a) setting the LD_LIBRARY_PATH, and (b) setting malloc debug flags, into the "gdb --args" command line
 gb_CppunitTest_GDBTRACE := $(subst gdb,\
-	gdb -return-child-result -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_CppunitTest_CPPTESTPRECOMMAND))" $(gb_CppunitTest_malloc_check),\
+	gdb -return-child-result -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_CppunitTest_CPPTESTPRECOMMAND))" $(gb_CppunitTest_malloc_check) $(gb_CppunitTest_DEBUGCPPUNIT),\
 	$(CPPUNITTRACE))
 else ifneq ($(filter lldb,$(CPPUNITTRACE)),)
 gb_CppunitTest_PREGDBTRACE := lo_dyldpathfile=$(call var2file,$(shell $(gb_MKTEMP)),500,settings set target.env-vars $(gb_CppunitTest_CPPTESTPRECOMMAND))
@@ -38,6 +37,7 @@ gb_CppunitTest_POSTGDBTRACE := rm $$lo_dyldpathfile
 else
 gb_CppunitTest_GDBTRACE := $(CPPUNITTRACE)
 endif
+ifneq ($(strip $(DEBUGCPPUNIT)),TRUE)
 gb_CppunitTest__interactive := $(true)
 endif
 endif
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index ea4f69efcd35..4d3003923433 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -194,7 +194,13 @@ endef
 # CppunitTest class
 
 ifeq ($(strip $(DEBUGCPPUNIT)),TRUE)
-gb_CppunitTest_GDBTRACE := gdb -nx -ex "set environment $(subst =, ,$(gb_CppunitTest_CPPTESTPRECOMMAND))" --batch --command=$(SRCDIR)/solenv/bin/gdbtrycatchtrace-stdout --args
+ifeq ($(strip $(CPPUNITTRACE)),)
+CPPUNITTRACE := gdb --args
+endif
+ifeq ($(filter gdb,$(CPPUNITTRACE)),)
+$(error For DEBUGCPPUNIT=TRUE, CPPUNITTRACE must be a command that runs gdb)
+endif
+gb_CppunitTest_DEBUGCPPUNIT := -nx --batch --command=$(SRCDIR)/solenv/bin/gdbtrycatchtrace-stdout
 endif
 
 # ExternalProject class


More information about the Libreoffice-commits mailing list