summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sal/cppunittester/cppunittester.cxx12
-rw-r--r--solenv/gbuild/CppunitTest.mk2
2 files changed, 9 insertions, 5 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index a57ea5501caf..e67c47610511 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -361,15 +361,19 @@ SAL_IMPLEMENT_MAIN()
std::string args;
std::string testlib;
sal_uInt32 index = 0;
- while (index < rtl_getAppCommandArgCount())
+ while (index < osl_getCommandArgCount())
{
rtl::OUString arg = getArgument(index);
- if (arg == "--target")
+ if (arg.startsWith("-env:CPPUNITTESTTARGET=", &path))
{
- path = getArgument(++index);
++index;
continue;
}
+ if (arg.startsWith("-env:"))
+ {
+ ++index;
+ continue; // ignore it here - will be read later
+ }
if ( arg != "--protector" )
{
if (testlib.empty())
@@ -385,7 +389,7 @@ SAL_IMPLEMENT_MAIN()
++index;
continue;
}
- if (rtl_getAppCommandArgCount() - index < 3) {
+ if (osl_getCommandArgCount() - index < 3) {
usageFailure();
}
rtl::OUString lib(getArgument(index + 1));
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index bea33ebd7f01..f5cc1dfa1ff6 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -102,7 +102,7 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_RUNTIMEDEPS)
PYTHONDONTWRITEBYTECODE=1) \
$(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTCOMMAND) \
$(call gb_LinkTarget_get_target,$(call gb_CppunitTest_get_linktarget,$*)) \
- $(call gb_CppunitTest__make_args) --target $@ \
+ $(call gb_CppunitTest__make_args) "-env:CPPUNITTESTTARGET=$@" \
$(if $(gb_CppunitTest__interactive),, \
> $@.log 2>&1 \
|| ($(if $(value gb_CppunitTest_postprocess), \