summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2011-07-11 00:40:49 +0300
committerTor Lillqvist <tml@iki.fi>2011-07-11 00:44:40 +0300
commitbc6a54572b5ad7ee33d79776d1284e21dd4c9d79 (patch)
tree1da87e4ee2d49ecf1fbe4927b2c778e6af8ec09b
parent53fb5e4fb4c9add26b248d4ee2f9f5bae4d5fee7 (diff)
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.
-rw-r--r--sal/osl/unx/module.c3
-rw-r--r--sal/osl/unx/system.h1
-rw-r--r--sal/qa/static/makefile.mk1
-rw-r--r--sal/qa/static/sal_cppunittester_all.cxx27
4 files changed, 28 insertions, 4 deletions
diff --git a/sal/osl/unx/module.c b/sal/osl/unx/module.c
index c06368cdc..a5beea9f6 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 d9c90d204..cc4d583ac 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 c76cf40be..0762e7337 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 b5ead718d..b5fb89b49 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();