[Libreoffice-commits] core.git: chart2/CppunitTest_chart2_pivot_chart_test.mk chart2/export_setup.mk include/unotest oox/CppunitTest_oox_drawingml.mk sc/CppunitTest_sc_bugfix_test.mk sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_pivottable_filters_test.mk sc/subsequent_setup.mk sd/CppunitTest_sd_import_tests.mk sd/CppunitTest_sd_import_tests_smartart.mk sd/CppunitTest_sd_misc_tests.mk sd/CppunitTest_sd_tiledrendering.mk sd/export_setup.mk solenv/clang-format sw/CppunitTest_sw_odfexport2.mk sw/CppunitTest_sw_odfexport.mk sw/CppunitTest_sw_odfimport.mk sw/ooxmlexport_setup.mk sw/uiwriter_setup.mk test/source unotest/source xmlsecurity/CppunitTest_xmlsecurity_signing.mk
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 21 13:27:45 UTC 2021
chart2/CppunitTest_chart2_pivot_chart_test.mk | 4 ++++
chart2/export_setup.mk | 4 ++++
include/unotest/getargument.hxx | 7 ++-----
oox/CppunitTest_oox_drawingml.mk | 4 ++++
sc/CppunitTest_sc_bugfix_test.mk | 4 ++++
sc/CppunitTest_sc_filters_test.mk | 4 ++++
sc/CppunitTest_sc_pivottable_filters_test.mk | 4 ++++
sc/subsequent_setup.mk | 4 ++++
sd/CppunitTest_sd_import_tests.mk | 4 ++++
sd/CppunitTest_sd_import_tests_smartart.mk | 4 ++++
sd/CppunitTest_sd_misc_tests.mk | 4 ++++
sd/CppunitTest_sd_tiledrendering.mk | 5 +++++
sd/export_setup.mk | 1 +
solenv/clang-format/excludelist | 2 +-
sw/CppunitTest_sw_odfexport.mk | 4 ++++
sw/CppunitTest_sw_odfexport2.mk | 4 ++++
sw/CppunitTest_sw_odfimport.mk | 4 ++++
sw/ooxmlexport_setup.mk | 5 +++++
sw/uiwriter_setup.mk | 4 ++++
test/source/bootstrapfixture.cxx | 16 ++++++++++++++++
unotest/source/cpp/getargument.cxx | 5 ++---
unotest/source/cpp/gettestargument.cxx | 5 ++---
unotest/source/cpp/officeconnection.cxx | 9 ++++-----
xmlsecurity/CppunitTest_xmlsecurity_signing.mk | 4 ++++
24 files changed, 98 insertions(+), 17 deletions(-)
New commits:
commit e854abe076155fc085b56549ced50b3ee9a095d2
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jul 21 13:08:48 2021 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Jul 21 15:27:02 2021 +0200
Avoid external processes picking up instdir/program/libnspr4.so
...which is a problem in ASan builds, as seen with a failing
CppunitTest_sd_import_tests (among lots of other similarly failing tests):
> Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-5.fc34.x86_64/lib/libsystemconf.so: ~/lo/core/instdir/program/libnspr4.so: undefined symbol: __asan_option_detect_stack_use_after_return
> at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
> at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
> at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
> at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
> at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
> at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
> at java.base/java.lang.System.loadLibrary(System.java:1873)
> at java.base/java.security.SystemConfigurator$1.run(SystemConfigurator.java:67)
> at java.base/java.security.SystemConfigurator$1.run(SystemConfigurator.java:65)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at java.base/java.security.SystemConfigurator.<clinit>(SystemConfigurator.java:65)
> at java.base/java.security.Security.initialize(Security.java:208)
> at java.base/java.security.Security$2.run(Security.java:93)
> at java.base/java.security.Security$2.run(Security.java:91)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at java.base/java.security.Security.<clinit>(Security.java:91)
> at java.base/sun.security.jca.ProviderList.<init>(ProviderList.java:176)
> at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:94)
> at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:92)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at java.base/sun.security.jca.ProviderList.fromSecurityProperties(ProviderList.java:91)
> at java.base/sun.security.jca.Providers.<clinit>(Providers.java:54)
> at java.base/java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:264)
> at java.base/java.security.SecureRandom.<init>(SecureRandom.java:219)
> at java.base/java.util.UUID$Holder.<clinit>(UUID.java:101)
> at java.base/java.util.UUID.randomUUID(UUID.java:147)
> at org.probatron.officeotron.sessionstorage.Store.putZippedResource(Unknown Source)
> at org.probatron.officeotron.CommandLineSubmission.<init>(Unknown Source)
> at org.probatron.officeotron.Driver.main(Unknown Source)
> warn:svl.items:1258842:1258842:svl/source/items/itempool.cxx:358: old secondary pool: EditEngineItemPool of pool: XOutdevItemPool must be empty.
> ~/lo/core/test/source/bootstrapfixture.cxx:232:SdImportTest::testDocumentLayout
> equality assertion failed
> - Expected: 0
> - Actual : 256
> - failed to execute: sh ~/lo/core/bin/officeotron.sh ~/lo/tmp/SdImportTest__testDocumentLayout_16w8dw.tmp > ~/lo/tmp/SdImportTest__testDocumentLayout_16w8dy.tmp
The solution reuses the arg-env bootstrap variable already used by
test::OfficeConnection::setUp (unotest/source/cpp/officeconnection.cxx) and for
that makes test::getArgumnet available outside Library_unotest. (For
simplicity, it adds the relevant gb_CppunitTest_add_arguments calls
unconditionally to the various *.mk files, even though the data is only used
conditionally for non-_WIN32 in test::BootstrapFixture::validate in
test/source/bootstrapfixture.cxx, at least for now.)
Not sure what exactly started to cause this issue now for my ASan builds on
Fedora 34.
Change-Id: I7a4d6c0e36b94935442c6c91d5ee967fcad61763
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119317
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/chart2/CppunitTest_chart2_pivot_chart_test.mk b/chart2/CppunitTest_chart2_pivot_chart_test.mk
index 3ec960e46a2d..af49c8a0b02f 100644
--- a/chart2/CppunitTest_chart2_pivot_chart_test.mk
+++ b/chart2/CppunitTest_chart2_pivot_chart_test.mk
@@ -127,4 +127,8 @@ $(eval $(call gb_CppunitTest_use_components,chart2_pivot_chart_test,\
$(eval $(call gb_CppunitTest_use_configuration,chart2_pivot_chart_test))
+$(eval $(call gb_CppunitTest_add_arguments,chart2_pivot_chart_test, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/chart2/export_setup.mk b/chart2/export_setup.mk
index 2d1ab7d638de..59bd27ef3938 100644
--- a/chart2/export_setup.mk
+++ b/chart2/export_setup.mk
@@ -138,6 +138,10 @@ $(eval $(call gb_CppunitTest_use_configuration,chart2_export$(1)))
$(call gb_CppunitTest_get_target,chart2_export$(1)): $(call gb_Package_get_target,postprocess_images)
+$(eval $(call gb_CppunitTest_add_arguments,chart2_export$(1), \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
endef
# vim: set noet sw=4 ts=4:
diff --git a/unotest/source/cpp/getargument.hxx b/include/unotest/getargument.hxx
similarity index 93%
rename from unotest/source/cpp/getargument.hxx
rename to include/unotest/getargument.hxx
index 1a95e487b39b..08eee217a343 100644
--- a/unotest/source/cpp/getargument.hxx
+++ b/include/unotest/getargument.hxx
@@ -24,18 +24,15 @@
#include <string_view>
#include <rtl/ustring.hxx>
+#include <unotest/detail/unotestdllapi.hxx>
namespace test {
-namespace detail {
-
// Obtain the value of an argument tunneled in via an "arg-<name>" bootstrap
// variable:
-bool getArgument(
+OOO_DLLPUBLIC_UNOTEST bool getArgument(
std::u16string_view name, OUString * value);
}
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/CppunitTest_oox_drawingml.mk b/oox/CppunitTest_oox_drawingml.mk
index dd0288074e32..262dfae49e5c 100644
--- a/oox/CppunitTest_oox_drawingml.mk
+++ b/oox/CppunitTest_oox_drawingml.mk
@@ -42,4 +42,8 @@ $(eval $(call gb_CppunitTest_use_custom_headers,oox_drawingml,\
$(eval $(call gb_CppunitTest_use_configuration,oox_drawingml))
+$(eval $(call gb_CppunitTest_add_arguments,oox_drawingml, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_bugfix_test.mk b/sc/CppunitTest_sc_bugfix_test.mk
index 813e0c9b4bad..1abda4990bb4 100644
--- a/sc/CppunitTest_sc_bugfix_test.mk
+++ b/sc/CppunitTest_sc_bugfix_test.mk
@@ -127,4 +127,8 @@ $(eval $(call gb_CppunitTest_use_packages,sc_bugfix_test,\
))
endif
+$(eval $(call gb_CppunitTest_add_arguments,sc_bugfix_test, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_filters_test.mk b/sc/CppunitTest_sc_filters_test.mk
index 94085b485247..a4e8dd58a6ec 100644
--- a/sc/CppunitTest_sc_filters_test.mk
+++ b/sc/CppunitTest_sc_filters_test.mk
@@ -121,4 +121,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_filters_test,\
$(eval $(call gb_CppunitTest_use_configuration,sc_filters_test))
+$(eval $(call gb_CppunitTest_add_arguments,sc_filters_test, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sc/CppunitTest_sc_pivottable_filters_test.mk b/sc/CppunitTest_sc_pivottable_filters_test.mk
index 5bd4c94354bb..9f63771315bc 100644
--- a/sc/CppunitTest_sc_pivottable_filters_test.mk
+++ b/sc/CppunitTest_sc_pivottable_filters_test.mk
@@ -118,4 +118,8 @@ $(eval $(call gb_CppunitTest_use_custom_headers,sc_pivottable_filters_test,\
$(eval $(call gb_CppunitTest_use_configuration,sc_pivottable_filters_test))
+$(eval $(call gb_CppunitTest_add_arguments,sc_pivottable_filters_test, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sc/subsequent_setup.mk b/sc/subsequent_setup.mk
index 355d0ca7435a..5e649e565c25 100644
--- a/sc/subsequent_setup.mk
+++ b/sc/subsequent_setup.mk
@@ -134,6 +134,10 @@ $(eval $(call gb_CppunitTest_use_packages,sc_subsequent_$(1), \
$(eval $(call gb_CppunitTest_use_more_fonts,sc_subsequent_$(1)))
+$(eval $(call gb_CppunitTest_add_arguments,sc_subsequent_$(1), \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
endef
# vim: set noet sw=4 ts=4:
diff --git a/sd/CppunitTest_sd_import_tests.mk b/sd/CppunitTest_sd_import_tests.mk
index 5f5c6ad56ccd..1568b4653493 100644
--- a/sd/CppunitTest_sd_import_tests.mk
+++ b/sd/CppunitTest_sd_import_tests.mk
@@ -129,4 +129,8 @@ ifneq ($(ENABLE_POPPLER),)
$(eval $(call gb_CppunitTest_use_executable,sd_import_tests,xpdfimport))
endif
+$(eval $(call gb_CppunitTest_add_arguments,sd_import_tests, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sd/CppunitTest_sd_import_tests_smartart.mk b/sd/CppunitTest_sd_import_tests_smartart.mk
index 6648716f1959..208f433fe9a6 100644
--- a/sd/CppunitTest_sd_import_tests_smartart.mk
+++ b/sd/CppunitTest_sd_import_tests_smartart.mk
@@ -74,4 +74,8 @@ $(eval $(call gb_CppunitTest_use_packages,sd_import_tests_smartart,\
oox_customshapes \
))
+$(eval $(call gb_CppunitTest_add_arguments,sd_import_tests_smartart, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sd/CppunitTest_sd_misc_tests.mk b/sd/CppunitTest_sd_misc_tests.mk
index 0d02125894c1..ce1e0dd86e2f 100644
--- a/sd/CppunitTest_sd_misc_tests.mk
+++ b/sd/CppunitTest_sd_misc_tests.mk
@@ -128,4 +128,8 @@ $(eval $(call gb_CppunitTest_use_configuration,sd_misc_tests))
$(call gb_CppunitTest_get_target,sd_misc_tests): $(call gb_Package_get_target,postprocess_images)
+$(eval $(call gb_CppunitTest_add_arguments,sd_misc_tests, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sd/CppunitTest_sd_tiledrendering.mk b/sd/CppunitTest_sd_tiledrendering.mk
index 3c5e12e2b265..a408aa4d7aa2 100644
--- a/sd/CppunitTest_sd_tiledrendering.mk
+++ b/sd/CppunitTest_sd_tiledrendering.mk
@@ -63,4 +63,9 @@ $(eval $(call gb_CppunitTest_use_uiconfigs,sd_tiledrendering, \
svx \
))
+
+$(eval $(call gb_CppunitTest_add_arguments,sd_tiledrendering, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sd/export_setup.mk b/sd/export_setup.mk
index 3e69a1b8713a..77e5a965c4e5 100644
--- a/sd/export_setup.mk
+++ b/sd/export_setup.mk
@@ -79,6 +79,7 @@ $(eval $(call gb_CppunitTest_use_configuration,sd_export_tests$(1)))
$(eval $(call gb_CppunitTest_add_arguments,sd_export_tests$(1),\
-env:SVG_DISABLE_FONT_EMBEDDING= \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
))
endef
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 368f8dd57931..bbc8023d6436 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -6261,6 +6261,7 @@ include/uno/threadpool.h
include/unoidl/unoidl.hxx
include/unotest/bootstrapfixturebase.hxx
include/unotest/filters-test.hxx
+include/unotest/getargument.hxx
include/unotest/gettestargument.hxx
include/unotest/officeconnection.hxx
include/unotest/toabsolutefileurl.hxx
@@ -14165,7 +14166,6 @@ unoidl/source/unoidl.cxx
unoidl/source/unoidlprovider.cxx
unoidl/source/unoidlprovider.hxx
unotest/source/cpp/filters-test.cxx
-unotest/source/cpp/getargument.hxx
unotest/source/cpp/officeconnection.cxx
unotest/source/cpp/toabsolutefileurl.cxx
unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx
diff --git a/sw/CppunitTest_sw_odfexport.mk b/sw/CppunitTest_sw_odfexport.mk
index bd8c0cc4581f..edd50c5ff78a 100644
--- a/sw/CppunitTest_sw_odfexport.mk
+++ b/sw/CppunitTest_sw_odfexport.mk
@@ -69,4 +69,8 @@ $(eval $(call gb_CppunitTest_use_uiconfigs,sw_odfexport, \
$(eval $(call gb_CppunitTest_use_more_fonts,sw_odfexport))
+$(eval $(call gb_CppunitTest_add_arguments,sw_odfexport, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_odfexport2.mk b/sw/CppunitTest_sw_odfexport2.mk
index 4ad073a9e2e2..325de15fec65 100644
--- a/sw/CppunitTest_sw_odfexport2.mk
+++ b/sw/CppunitTest_sw_odfexport2.mk
@@ -69,4 +69,8 @@ $(eval $(call gb_CppunitTest_use_uiconfigs,sw_odfexport2, \
$(eval $(call gb_CppunitTest_use_more_fonts,sw_odfexport2))
+$(eval $(call gb_CppunitTest_add_arguments,sw_odfexport2, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_odfimport.mk b/sw/CppunitTest_sw_odfimport.mk
index dabab5254279..718770f090f5 100644
--- a/sw/CppunitTest_sw_odfimport.mk
+++ b/sw/CppunitTest_sw_odfimport.mk
@@ -61,4 +61,8 @@ $(eval $(call gb_CppunitTest_use_rdb,sw_odfimport,services))
$(eval $(call gb_CppunitTest_use_configuration,sw_odfimport))
+$(eval $(call gb_CppunitTest_add_arguments,sw_odfimport, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/sw/ooxmlexport_setup.mk b/sw/ooxmlexport_setup.mk
index 0381e3e24829..404ee5153438 100644
--- a/sw/ooxmlexport_setup.mk
+++ b/sw/ooxmlexport_setup.mk
@@ -89,6 +89,11 @@ $(eval $(call gb_CppunitTest_use_packages,sw_ooxmlexport$(1),\
))
endif
+
+$(eval $(call gb_CppunitTest_add_arguments,sw_ooxmlexport$(1), \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
endef
# vim: set noet sw=4 ts=4:
diff --git a/sw/uiwriter_setup.mk b/sw/uiwriter_setup.mk
index ce7544772447..a4def8e80120 100644
--- a/sw/uiwriter_setup.mk
+++ b/sw/uiwriter_setup.mk
@@ -90,6 +90,10 @@ $(call gb_CppunitTest_get_target,sw_uiwriter$(1)) : $(call gb_Library_get_target
$(eval $(call gb_CppunitTest_use_more_fonts,sw_uiwriter$(1)))
+$(eval $(call gb_CppunitTest_add_arguments,sw_uiwriter$(1), \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
endef
# vim: set noet sw=4 ts=4:
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index a1cc861ef8db..78bdba431c77 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -24,6 +24,7 @@
#include <vcl/graphicfilter.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
+#include <unotest/getargument.hxx>
#include <unotools/tempfile.hxx>
#include <vcl/salgtype.hxx>
#include <vcl/scheduler.hxx>
@@ -190,6 +191,21 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor
OUString aOutputFile = aOutput.GetFileName();
OUString aCommand = aValidator + " " + rPath + " > " + aOutputFile;
+#if !defined _WIN32
+ // For now, this is only needed by some Linux ASan builds, so keep it simply and disable it on
+ // Windows (which doesn't support the relevant shell syntax for (un-)setting environment
+ // variables).
+ OUString env;
+ if (test::getArgument(u"env", &env)) {
+ auto const n = env.indexOf('=');
+ if (n == -1) {
+ aCommand = "unset -v " + env + " && " + aCommand;
+ } else {
+ aCommand = env + " " + aCommand;
+ }
+ }
+#endif
+
SAL_INFO("test", "BootstrapFixture::validate: executing '" << aCommand << "'");
int returnValue = system(OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8).getStr());
diff --git a/unotest/source/cpp/getargument.cxx b/unotest/source/cpp/getargument.cxx
index 5c40a0a324b4..22cd39fc5960 100644
--- a/unotest/source/cpp/getargument.cxx
+++ b/unotest/source/cpp/getargument.cxx
@@ -22,10 +22,9 @@
#include <osl/diagnose.h>
#include <rtl/bootstrap.hxx>
#include <rtl/ustring.hxx>
+#include <unotest/getargument.hxx>
-#include "getargument.hxx"
-
-namespace test::detail
+namespace test
{
bool getArgument(std::u16string_view name, OUString* value)
{
diff --git a/unotest/source/cpp/gettestargument.cxx b/unotest/source/cpp/gettestargument.cxx
index 915ea5690e82..4423ec3a6bb2 100644
--- a/unotest/source/cpp/gettestargument.cxx
+++ b/unotest/source/cpp/gettestargument.cxx
@@ -20,15 +20,14 @@
#include <sal/config.h>
#include <rtl/ustring.hxx>
+#include <unotest/getargument.hxx>
#include <unotest/gettestargument.hxx>
-#include "getargument.hxx"
-
namespace test
{
bool getTestArgument(std::u16string_view name, OUString* value)
{
- return detail::getArgument(OUString(OUString::Concat("testarg.") + name), value);
+ return getArgument(OUString(OUString::Concat("testarg.") + name), value);
}
}
diff --git a/unotest/source/cpp/officeconnection.cxx b/unotest/source/cpp/officeconnection.cxx
index 55525736f346..649d636d0fa6 100644
--- a/unotest/source/cpp/officeconnection.cxx
+++ b/unotest/source/cpp/officeconnection.cxx
@@ -30,11 +30,10 @@
#include <osl/test/uniquepipename.hxx>
#include <osl/time.h>
#include <sal/macros.h>
+#include <unotest/getargument.hxx>
#include <unotest/officeconnection.hxx>
#include <unotest/toabsolutefileurl.hxx>
-#include "getargument.hxx"
-
namespace test {
OfficeConnection::OfficeConnection(): process_(nullptr) {}
@@ -48,7 +47,7 @@ void OfficeConnection::setUp() {
OUString desc;
OUString argSoffice;
CPPUNIT_ASSERT(
- detail::getArgument(
+ getArgument(
u"soffice",
&argSoffice));
if (argSoffice.match("path:")) {
@@ -62,7 +61,7 @@ void OfficeConnection::setUp() {
OUString acceptArg("--accept=" + desc + ";urp");
OUString argUser;
CPPUNIT_ASSERT(
- detail::getArgument(u"user", &argUser));
+ getArgument(u"user", &argUser));
OUString userArg("-env:UserInstallation=" + toAbsoluteFileUrl(argUser));
OUString jreArg(
"-env:UNO_JAVA_JFW_ENV_JREHOME=true");
@@ -72,7 +71,7 @@ void OfficeConnection::setUp() {
jreArg.pData };
rtl_uString ** envs = nullptr;
OUString argEnv;
- if (detail::getArgument(u"env", &argEnv))
+ if (getArgument(u"env", &argEnv))
{
envs = &argEnv.pData;
}
diff --git a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
index 52cd621fe084..323c5c1bb37e 100644
--- a/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
+++ b/xmlsecurity/CppunitTest_xmlsecurity_signing.mk
@@ -78,4 +78,8 @@ $(eval $(call gb_CppunitTest_use_packages,xmlsecurity_signing,\
))
endif
+$(eval $(call gb_CppunitTest_add_arguments,xmlsecurity_signing, \
+ -env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
+))
+
# vim: set noet sw=4 ts=4:
More information about the Libreoffice-commits
mailing list