Kaydet (Commit) 999a9c18 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Do build cppunit for iOS, too

I am writing a separate unit test app that will include selected
existing unit tests that make sense and are important to run on iOS.

Change-Id: I4722f1ed872ba21e181eeba5ed3b58e82d8fed72
Reviewed-on: https://gerrit.libreoffice.org/61049Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 2f9c6940
...@@ -58,6 +58,7 @@ ANDROID) ...@@ -58,6 +58,7 @@ ANDROID)
;; ;;
IOS) IOS)
oslibs="$WORKDIR/UnpackedTarball/icu/source/stubdata/*.a" oslibs="$WORKDIR/UnpackedTarball/icu/source/stubdata/*.a"
oslibs="$oslibs $WORKDIR/UnpackedTarball/cppunit/src/cppunit/.libs/*.a"
;; ;;
*) *)
oslibs= oslibs=
......
...@@ -8028,7 +8028,7 @@ fi ...@@ -8028,7 +8028,7 @@ fi
dnl =================================================================== dnl ===================================================================
dnl Check for system cppunit dnl Check for system cppunit
dnl =================================================================== dnl ===================================================================
if test "$cross_compiling" != "yes"; then if test "$_os" != "Android" ; then
libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0]) libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
fi fi
......
...@@ -11,6 +11,8 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,cppunit)) ...@@ -11,6 +11,8 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,cppunit))
$(eval $(call gb_UnpackedTarball_set_tarball,cppunit,$(CPPUNIT_TARBALL),,cppunit)) $(eval $(call gb_UnpackedTarball_set_tarball,cppunit,$(CPPUNIT_TARBALL),,cppunit))
$(eval $(call gb_UnpackedTarball_update_autoconf_configs,cppunit))
# gcc9.patch.0 addressed upstream with <https://gerrit.libreoffice.org/58690> "Avoid GCC 9 # gcc9.patch.0 addressed upstream with <https://gerrit.libreoffice.org/58690> "Avoid GCC 9
# -Wdeprecated-copy": # -Wdeprecated-copy":
$(eval $(call gb_UnpackedTarball_add_patches,cppunit,\ $(eval $(call gb_UnpackedTarball_add_patches,cppunit,\
......
...@@ -181,85 +181,6 @@ static oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* ...@@ -181,85 +181,6 @@ static oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo*
} }
#ifdef IOS
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
// Swiped from cppuhelper/qa/misc/test_misc.cxx. Ideally we should
// have a unit test app for iOS that would somehow include relevant
// unit tests from source files all over the place.
static void testExceptions()
{
css::uno::Any aSavedExceptionAny;
std::exception_ptr
aSavedException; /// exception caught during unzipping is saved to be thrown during reading
try
{
throw css::uno::RuntimeException("RuntimeException");
}
catch (...)
{
aSavedException = std::current_exception();
}
assert(bool(aSavedException));
try
{
std::rethrow_exception(aSavedException);
}
catch (const css::uno::RuntimeException&)
{
// the expected case
aSavedExceptionAny = cppu::getCaughtException();
}
catch (...)
{
assert(false);
}
assert(aSavedExceptionAny.hasValue());
try
{
throw css::ucb::InteractiveAugmentedIOException();
}
catch (const css::ucb::InteractiveAugmentedIOException&)
{
aSavedExceptionAny = cppu::getCaughtException();
}
catch (const css::uno::Exception&)
{
assert(false);
}
catch (...)
{
assert(false);
}
assert(aSavedExceptionAny.hasValue());
try
{
css::ucb::InteractiveAugmentedIOException iaie;
css::uno::Any aEx = css::uno::makeAny(iaie);
// css::uno::Exception e;
// css::uno::Any aEx = css::uno::makeAny(e);
cppu::throwException(aEx);
}
catch (const css::ucb::InteractiveAugmentedIOException&)
{
}
catch (const css::uno::Exception& e)
{
assert(false);
}
catch (...)
{
assert(false);
}
}
#endif
int ImplSVMain() int ImplSVMain()
{ {
// The 'real' SVMain() // The 'real' SVMain()
...@@ -271,10 +192,6 @@ int ImplSVMain() ...@@ -271,10 +192,6 @@ int ImplSVMain()
bool bInit = isInitVCL() || InitVCL(); bool bInit = isInitVCL() || InitVCL();
#ifdef IOS
testExceptions();
#endif
if( bInit ) if( bInit )
{ {
// call application main // call application main
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment