[Libreoffice-commits] .: sal/osl sal/qa

Tor Lillqvist tml at kemper.freedesktop.org
Sun Jul 10 14:45:13 PDT 2011


 sal/osl/unx/module.c                    |    3 ++-
 sal/osl/unx/system.h                    |    1 +
 sal/qa/static/makefile.mk               |    1 -
 sal/qa/static/sal_cppunittester_all.cxx |   27 +++++++++++++++++++++++++--
 4 files changed, 28 insertions(+), 4 deletions(-)

New commits:
commit bc6a54572b5ad7ee33d79776d1284e21dd4c9d79
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Jul 11 00:40:49 2011 +0300

    Make iOS sal unit testing actually work
    
    We must call the initialize() methods of the plugins which for iOS
    aren't actually plugins in the sense of being dynamically loaded, but
    still. Unfortunately this means we have to list the plugin interface
    getter functions explicitly in the sal_cppunittester_all source.

diff --git a/sal/osl/unx/module.c b/sal/osl/unx/module.c
index c06368c..a5beea9 100644
--- a/sal/osl/unx/module.c
+++ b/sal/osl/unx/module.c
@@ -208,7 +208,8 @@ osl_getFunctionSymbol(oslModule module, rtl_uString *puFunctionSymbolName)
 sal_Bool SAL_CALL osl_getModuleURLFromAddress(void * addr, rtl_uString ** ppLibraryUrl)
 {
     sal_Bool result = sal_False;
-#ifndef NO_DL_FUNCTIONS
+/* Bah, we do want to use dladdr here also on iOS, I think? */
+#if !defined(NO_DL_FUNCTIONS) || defined(IOS)
 #if defined(AIX)
     int i;
     int size = 4 * 1024;
diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h
index d9c90d2..cc4d583 100644
--- a/sal/osl/unx/system.h
+++ b/sal/osl/unx/system.h
@@ -354,6 +354,7 @@ int macxp_resolveAlias(char *path, int buflen);
 #	ifndef ETIME
 #		define  ETIME ETIMEDOUT
 #	endif
+#	include <dlfcn.h>
 #	include <pthread.h>
 #	include <sys/file.h>
 #	include <sys/ioctl.h>
diff --git a/sal/qa/static/makefile.mk b/sal/qa/static/makefile.mk
index c76cf40..0762e73 100644
--- a/sal/qa/static/makefile.mk
+++ b/sal/qa/static/makefile.mk
@@ -54,7 +54,6 @@ APP1LIBS += \
     $(SLB)/qa_ostringbuffer.lib \
     $(SLB)/qa_osl_condition.lib \
     $(SLB)/qa_osl_file.lib \
-    $(SLB)/qa_osl_process.lib \
     $(SLB)/qa_osl_security.lib
 
 APP1STDLIBS = $(CPPUNITLIB) $(SALLIB)
diff --git a/sal/qa/static/sal_cppunittester_all.cxx b/sal/qa/static/sal_cppunittester_all.cxx
index b5ead71..b5fb89b 100644
--- a/sal/qa/static/sal_cppunittester_all.cxx
+++ b/sal/qa/static/sal_cppunittester_all.cxx
@@ -49,6 +49,8 @@
 #include "cppunit/TestResult.h"
 #include "cppunit/TestResultCollector.h"
 #include "cppunit/TestRunner.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "cppunit/plugin/PlugInParameters.h"
 #include "cppunit/extensions/TestFactoryRegistry.h"
 #include "cppunit/portability/Stream.h"
 
@@ -111,12 +113,33 @@ public:
 };
 }
 
+extern "C" CppUnitTestPlugIn *cppunitTest_qa_ByteSequence(void),
+           *cppunitTest_qa_ostringbuffer(void),
+           *cppunitTest_qa_osl_condition(void),
+           *cppunitTest_qa_osl_File(void),
+           *cppunitTest_tcwf(void),
+           *cppunitTest_osl_old_test_file(void),
+           *cppunitTest_qa_osl_security(void);
+
 SAL_IMPLEMENT_MAIN() {
+    TestPlugInSignature plugs[] = {
+        cppunitTest_qa_ByteSequence,
+        cppunitTest_qa_ostringbuffer,
+        cppunitTest_qa_osl_condition,
+        cppunitTest_qa_osl_File,
+        cppunitTest_tcwf,
+        cppunitTest_osl_old_test_file,
+        cppunitTest_qa_osl_security,
+        NULL
+    };
     CppUnit::TestResult result;
-    cppunittester::LibreOfficeProtector *throw_protector = 0;
     std::string args;
-    sal_uInt32 index = 0;
     bool ok = false;
+    for (TestPlugInSignature *plug = plugs; *plug != NULL; plug++) {
+        CppUnitTestPlugIn *iface;
+        iface = (*plug)();
+        iface->initialize(&CppUnit::TestFactoryRegistry::getRegistry(), CppUnit::PlugInParameters());
+    }
     ProtectedFixtureFunctor tests(args, result);
     ok = tests.run();
 


More information about the Libreoffice-commits mailing list