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

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.
üst e4518218
......@@ -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;
......
......@@ -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>
......
......@@ -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)
......
......@@ -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();
......
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