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

Tor Lillqvist tml at kemper.freedesktop.org
Sun Jul 10 04:47:26 PDT 2011


 sal/osl/unx/makefile.mk                         |    6 -
 sal/osl/unx/nlsupport.c                         |    6 -
 sal/osl/unx/osxlocale.cxx                       |    2 
 sal/prj/build.lst                               |    1 
 sal/qa/ByteSequence/makefile.mk                 |    6 -
 sal/qa/OStringBuffer/makefile.mk                |    6 -
 sal/qa/cppunit_local.mk                         |    4 
 sal/qa/makefile.mk                              |    4 
 sal/qa/osl/condition/makefile.mk                |   10 -
 sal/qa/osl/file/makefile.mk                     |    6 -
 sal/qa/osl/file/osl_File.cxx                    |    6 -
 sal/qa/osl/file/osl_File_Const.h                |    2 
 sal/qa/osl/file/osl_old_test_file.cxx           |    4 
 sal/qa/osl/file/test_cpy_wrt_file.cxx           |    8 +
 sal/qa/osl/getsystempathfromfileurl/makefile.mk |    6 -
 sal/qa/osl/module/makefile.mk                   |    7 -
 sal/qa/osl/module/osl_Module.cxx                |    2 
 sal/qa/osl/process/makefile.mk                  |    4 
 sal/qa/osl/process/osl_Thread.cxx               |    4 
 sal/qa/osl/process/osl_process.cxx              |    4 
 sal/qa/osl/security/makefile.mk                 |    8 -
 sal/qa/osl/security/osl_Security.cxx            |   16 +--
 sal/qa/osl/security/osl_Security_Const.h        |   13 +-
 sal/qa/rtl/alloc/makefile.mk                    |    6 -
 sal/qa/rtl/cipher/makefile.mk                   |    6 -
 sal/qa/rtl/crc32/makefile.mk                    |    6 -
 sal/qa/rtl/doublelock/makefile.mk               |    6 -
 sal/qa/rtl/locale/makefile.mk                   |    6 -
 sal/qa/rtl/oustringbuffer/makefile.mk           |    6 -
 sal/qa/rtl/strings/makefile.mk                  |    6 -
 sal/qa/sal/makefile.mk                          |    6 -
 sal/qa/static/makefile.mk                       |   63 ++++++++++++
 sal/qa/static/sal_cppunittester_all.cxx         |  126 ++++++++++++++++++++++++
 33 files changed, 293 insertions(+), 79 deletions(-)

New commits:
commit 51f0313728164fdb38dda2b49c7e0b52d78bc4dc
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sun Jul 10 14:43:03 2011 +0300

    Do build sal unit tests for iOS, too
    
    We can't run them in the normal way, but we build the tests as static
    archives, which we link into the single sal_cppunittester_all
    executable. (Work in progress, so far just a part of the tests are
    linked into it.)
    
    There is no makefilery yet to actually construct a complete iOS app
    bundle (.app directory), so just copy (in this case) the
    sal_cppunittester_all iOS executable on top of the executbale some
    dummy iOS app you build in Xcode... works fine, can be debugged that
    way.

diff --git a/sal/osl/unx/makefile.mk b/sal/osl/unx/makefile.mk
index cb566ae..2ec11e1 100644
--- a/sal/osl/unx/makefile.mk
+++ b/sal/osl/unx/makefile.mk
@@ -49,6 +49,10 @@ ENABLE_EXCEPTIONS=TRUE
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
 
+.IF "$(OS)" == "IOS"
+CFLAGSCXX+=-D__IPHONE_OS_VERSION_MIN_REQUIRED=40300
+.ENDIF
+
 # --- Files --------------------------------------------------------
 
 SLOFILES= \
@@ -113,7 +117,7 @@ OBJFILES=   $(OBJ)$/conditn.obj  \
             $(OBJ)$/readwrite_helper.obj
             
 
-.IF "$(OS)"=="MACOSX"
+.IF "$(OS)"=="MACOSX" || "$(OS)"=="IOS"
 SLOFILES += $(SLO)$/osxlocale.obj
 .ENDIF
 
diff --git a/sal/qa/ByteSequence/makefile.mk b/sal/qa/ByteSequence/makefile.mk
index 60d87c8..cc2d79d 100644
--- a/sal/qa/ByteSequence/makefile.mk
+++ b/sal/qa/ByteSequence/makefile.mk
@@ -35,7 +35,9 @@ ENABLE_EXCEPTIONS = TRUE
 
 CFLAGSCXX += $(CPPUNIT_CFLAGS)
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 SHL1IMPLIB = i$(SHL1TARGET)
 SHL1OBJS = $(SLO)/ByteSequence.obj
@@ -47,7 +49,5 @@ DEF1NAME = $(SHL1TARGET)
 
 SLOFILES = $(SHL1OBJS)
 
-.ENDIF
-
 .INCLUDE: target.mk
 .INCLUDE: $(PRJ)$/qa$/cppunit_local.mk
diff --git a/sal/qa/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk
index e6419b7..4149c58 100644
--- a/sal/qa/OStringBuffer/makefile.mk
+++ b/sal/qa/OStringBuffer/makefile.mk
@@ -36,7 +36,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -63,8 +65,6 @@ SHL1RPATH = NONE
 # do this here, so we get right dependencies
 SLOFILES=$(SHL1OBJS)
 
-.ENDIF
-
 # --- Targets ------------------------------------------------------
 
 .INCLUDE :  target.mk
diff --git a/sal/qa/makefile.mk b/sal/qa/makefile.mk
index e9eec4d..391ac66 100644
--- a/sal/qa/makefile.mk
+++ b/sal/qa/makefile.mk
@@ -47,8 +47,6 @@ TARGET=whole_sal_qa
 ALLTAR : test_all
 .ENDIF
 
-.IF "$(CROSS_COMPILING)"!="YES"
-
 # OTHER STUFF ------------------------------------------------------
 # test : test_all
 
@@ -62,5 +60,3 @@ test_all:
         @echo - start sal unit tests
         @echo ----------------------------------------------------------
         $(PERL) buildall.pl $(TESTOPT)
-
-.ENDIF
diff --git a/sal/qa/osl/condition/makefile.mk b/sal/qa/osl/condition/makefile.mk
index 89a4fb3..8412c68 100644
--- a/sal/qa/osl/condition/makefile.mk
+++ b/sal/qa/osl/condition/makefile.mk
@@ -36,7 +36,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -53,10 +55,8 @@ SHL1IMPLIB= i$(SHL1TARGET)
 
 DEF1NAME    =$(SHL1TARGET)
 SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
-# auto generated Target:Condition
-# END ------------------------------------------------------------------
-
-.ENDIF
+# ------------------------------------------------------------------
+SLOFILES=$(SHL1OBJS)
 
 # --- Targets ------------------------------------------------------
 
diff --git a/sal/qa/osl/file/makefile.mk b/sal/qa/osl/file/makefile.mk
index 4cb2ffe..de85e5e 100644
--- a/sal/qa/osl/file/makefile.mk
+++ b/sal/qa/osl/file/makefile.mk
@@ -36,8 +36,6 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
-
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
 
@@ -79,9 +77,7 @@ SHL3VERSIONMAP = $(PRJ)$/qa$/export.map
 
 #------------------------------- All object files -------------------------------
 # do this here, so we get right dependencies
-SLOFILES=$(SHL1OBJS)
-
-.ENDIF
+SLOFILES=$(SHL1OBJS) $(SHL2OBJS) $(SHL3OBJS)
 
 # --- Targets ------------------------------------------------------
 
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 6a25539..e4acd65 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -29,6 +29,10 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sal.hxx"
 
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_qa_osl_File
+#endif
+
 //------------------------------------------------------------------------
 // include files
 //------------------------------------------------------------------------
diff --git a/sal/qa/osl/file/osl_old_test_file.cxx b/sal/qa/osl/file/osl_old_test_file.cxx
index 80e9e07..e186490 100644
--- a/sal/qa/osl/file/osl_old_test_file.cxx
+++ b/sal/qa/osl/file/osl_old_test_file.cxx
@@ -29,6 +29,10 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sal.hxx"
 
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_osl_old_test_file
+#endif
+
 // LLA:
 // this file is converted to use with testshl2
 // original was placed in sal/test/textenc.cxx
diff --git a/sal/qa/osl/file/test_cpy_wrt_file.cxx b/sal/qa/osl/file/test_cpy_wrt_file.cxx
index 8911631..5613530 100644
--- a/sal/qa/osl/file/test_cpy_wrt_file.cxx
+++ b/sal/qa/osl/file/test_cpy_wrt_file.cxx
@@ -29,6 +29,10 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sal.hxx"
 
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_tcwf
+#endif
+
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
@@ -43,7 +47,7 @@ using ::rtl::OUStringToOString;
 using ::rtl::OString;
 
 //Use to silence OSL_ warnings for a deliberate error
-extern "C" void SAL_CALL suppressOslDebugMessage( const sal_Char *, sal_Int32, const sal_Char * )
+extern "C" void SAL_CALL suppressOslDebugMessage2( const sal_Char *, sal_Int32, const sal_Char * )
 {
 }
 
@@ -71,7 +75,7 @@ public:
         //deliberate errors, suppress run-time warning for operations on
         //un-opened File
         pfunc_osl_printDetailedDebugMessage pOldDebugMessageFunc =
-            osl_setDetailedDebugMessageFunc( &suppressOslDebugMessage );
+            osl_setDetailedDebugMessageFunc( &suppressOslDebugMessage2 );
 
         char buffer[1];
         sal_uInt64 written = 0;
diff --git a/sal/qa/osl/getsystempathfromfileurl/makefile.mk b/sal/qa/osl/getsystempathfromfileurl/makefile.mk
index 769313a..71597ba 100644
--- a/sal/qa/osl/getsystempathfromfileurl/makefile.mk
+++ b/sal/qa/osl/getsystempathfromfileurl/makefile.mk
@@ -37,7 +37,9 @@ ENABLE_EXCEPTIONS = TRUE
 
 .INCLUDE: settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGSCXX += $(CPPUNIT_CFLAGS)
 
@@ -53,8 +55,6 @@ DEF1NAME = $(SHL1TARGET)
 
 SLOFILES = $(SHL1OBJS)
 
-.ENDIF
-
 .INCLUDE: target.mk
 .INCLUDE: _cppunit.mk
 
diff --git a/sal/qa/osl/module/makefile.mk b/sal/qa/osl/module/makefile.mk
index 22a4811..7fdf0ca 100644
--- a/sal/qa/osl/module/makefile.mk
+++ b/sal/qa/osl/module/makefile.mk
@@ -36,7 +36,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -72,9 +74,8 @@ SHL2DEF=    $(MISC)$/$(SHL2TARGET).def
 
 DEF2NAME    =$(SHL2TARGET)
 SHL2VERSIONMAP= $(PRJ)$/qa$/export.map
-# END ------------------------------------------------------------------
 
-.ENDIF
+SLOFILES = $(SHL2OBJS)
 
 # --- Targets ------------------------------------------------------
 
diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx
index 983cfe7..42fdc79 100644
--- a/sal/qa/osl/module/osl_Module.cxx
+++ b/sal/qa/osl/module/osl_Module.cxx
@@ -190,6 +190,8 @@ namespace osl_Module
             ::osl::Module aMod;
             bRes = aMod.is();
 
+            printf ("Here we are\n");
+
             CPPUNIT_ASSERT_MESSAGE( "#test comment#: test constructor without parameter.",
                                     sal_False == bRes  );
         }
diff --git a/sal/qa/osl/process/makefile.mk b/sal/qa/osl/process/makefile.mk
index 17bac5f..cf78cd5 100644
--- a/sal/qa/osl/process/makefile.mk
+++ b/sal/qa/osl/process/makefile.mk
@@ -35,8 +35,6 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
-
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
 
@@ -79,8 +77,6 @@ SHL2DEPN=$(APP3TARGETN) \
 
 SLOFILES=$(SHL1OBJS) $(SHL2OBJS)
 
-.ENDIF
-
 # --- Targets ------------------------------------------------------
 
 .INCLUDE :  target.mk
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 0def479..de0589f 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -29,6 +29,10 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sal.hxx"
 
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_osl_Thread
+#endif
+
 #ifdef WNT
 #define NOMINMAX
 #include <windows.h>
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index 9fb80a6..3a34783 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -29,6 +29,10 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sal.hxx"
 
+#ifdef IOS
+#define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_osl_process
+#endif
+
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/plugin/TestPlugIn.h>
diff --git a/sal/qa/osl/security/makefile.mk b/sal/qa/osl/security/makefile.mk
index e6fbed4..58361fb 100755
--- a/sal/qa/osl/security/makefile.mk
+++ b/sal/qa/osl/security/makefile.mk
@@ -36,7 +36,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -57,10 +59,8 @@ SHL1DEF=    $(MISC)$/$(SHL1TARGET).def
 
 DEF1NAME    =$(SHL1TARGET)
 SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
-# auto generated Target:Security
-# END ------------------------------------------------------------------
 
-.ENDIF
+SLOFILES = $(SHL1OBJS)
 
 # --- Targets ------------------------------------------------------
 
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index faa0097..230b27e 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -126,12 +126,12 @@ namespace osl_Security
 
 
         CPPUNIT_TEST_SUITE( logonUser );
-        if  ( !aStringForward.equals( aNullURL )  && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) ==  aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
+        if  ( !aStringForward.equals( aNullUrl )  && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) ==  aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
         /// if user name and passwd are forwarded
         {
             CPPUNIT_TEST( logonUser_user_pwd );
         }
-        if  ( !aStringForward.equals( aNullURL )  && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) !=  aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
+        if  ( !aStringForward.equals( aNullUrl )  && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 && ( aStringForward.indexOf( ( sal_Unicode ) ' ' ) !=  aStringForward.lastIndexOf( ( sal_Unicode ) ' ' ) ) )
         /// if user name and passwd and file server are forwarded
         {
             CPPUNIT_TEST( logonUser_user_pwd_server );
@@ -587,31 +587,31 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
     t_print("#\n#Retrived system information is below:\n");
 
     t_print("Computer Name:              ");
-    if ( strComputerName == aNullURL )
+    if ( strComputerName == aNullUrl )
         t_print("Not retrived\n" );
     else
         printUString( strComputerName );
 
     t_print("Current User Name:          ");
-    if ( strUserName == aNullURL )
+    if ( strUserName == aNullUrl )
         t_print("Not retrived\n" );
     else
         printUString( strUserName );
 
     t_print("Current User Home Directory:");
-    if ( strHomeDirectory == aNullURL )
+    if ( strHomeDirectory == aNullUrl )
         t_print("Not retrived\n" );
     else
         printUString( strHomeDirectory );
 
     t_print("Current Config Directory:   ");
-    if ( strConfigDirectory == aNullURL )
+    if ( strConfigDirectory == aNullUrl )
         t_print("Not retrived\n" );
     else
         printUString( strConfigDirectory );
 
     t_print("Current UserID:             ");
-    if ( strUserID == aNullURL )
+    if ( strUserID == aNullUrl )
         t_print("Not retrived\n" );
     else
         printUString( strUserID );
@@ -624,7 +624,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
 
     /// get and display forwarded text if available.
     aStringForward = ::rtl::OUString::createFromAscii( parameters.getCommandLine().c_str() );
-    if ( !aStringForward.equals( aNullURL ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 )
+    if ( !aStringForward.equals( aNullUrl ) && aStringForward.indexOf( (sal_Unicode)' ' ) != -1 )
     {
         sal_Int32 nFirstSpacePoint = aStringForward.indexOf( (sal_Unicode)' ' );;
         sal_Int32 nLastSpacePoint = aStringForward.lastIndexOf( (sal_Unicode)' ' );;
diff --git a/sal/qa/osl/security/osl_Security_Const.h b/sal/qa/osl/security/osl_Security_Const.h
index 9298324..197745f 100644
--- a/sal/qa/osl/security/osl_Security_Const.h
+++ b/sal/qa/osl/security/osl_Security_Const.h
@@ -63,11 +63,15 @@ const char pTestString[17] = "Sun Microsystems";
 //------------------------------------------------------------------------
 // condition names
 //------------------------------------------------------------------------
-OSLTEST_DECLARE_USTRING( NullURL,  "" );
 
-::rtl::OUString aLogonUser( aNullURL ), aLogonPasswd( aNullURL ), aFileServer( aNullURL ), aStringForward( aNullURL );
-::rtl::OUString strUserName( aNullURL ) , strComputerName( aNullURL ) , strHomeDirectory( aNullURL );
-::rtl::OUString strConfigDirectory( aNullURL ), strUserID( aNullURL );
+// Intentionally different from the aNullURL in osl_File_Const.h to avoid
+// duplicate symbols as all the unit tests here get linked together for iOS...
+
+OSLTEST_DECLARE_USTRING( NullUrl,  "" );
+
+::rtl::OUString aLogonUser( aNullUrl ), aLogonPasswd( aNullUrl ), aFileServer( aNullUrl ), aStringForward( aNullUrl );
+::rtl::OUString strUserName( aNullUrl ) , strComputerName( aNullUrl ) , strHomeDirectory( aNullUrl );
+::rtl::OUString strConfigDirectory( aNullUrl ), strUserID( aNullUrl );
 
 sal_Bool isAdmin = sal_False;
 
diff --git a/sal/qa/rtl/alloc/makefile.mk b/sal/qa/rtl/alloc/makefile.mk
index d829b14..5ac7a79 100755
--- a/sal/qa/rtl/alloc/makefile.mk
+++ b/sal/qa/rtl/alloc/makefile.mk
@@ -35,7 +35,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -56,8 +58,6 @@ SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
 # do this here, so we get right dependencies
 # SLOFILES=$(SHL1OBJS)
 
-.ENDIF
-
 # --- Targets ------------------------------------------------------
 
 .INCLUDE :  target.mk
diff --git a/sal/qa/rtl/cipher/makefile.mk b/sal/qa/rtl/cipher/makefile.mk
index 30fc678..15639f2 100644
--- a/sal/qa/rtl/cipher/makefile.mk
+++ b/sal/qa/rtl/cipher/makefile.mk
@@ -37,7 +37,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -65,8 +67,6 @@ SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
 # do this here, so we get right dependencies
 # SLOFILES=$(SHL1OBJS)
 
-.ENDIF
-
 # --- Targets ------------------------------------------------------
 
 .INCLUDE :  target.mk
diff --git a/sal/qa/rtl/crc32/makefile.mk b/sal/qa/rtl/crc32/makefile.mk
index 23e7fd2..c868227 100755
--- a/sal/qa/rtl/crc32/makefile.mk
+++ b/sal/qa/rtl/crc32/makefile.mk
@@ -35,7 +35,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -63,8 +65,6 @@ SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
 # do this here, so we get right dependencies
 # SLOFILES=$(SHL1OBJS)
 
-.ENDIF
-
 # --- Targets ------------------------------------------------------
 
 .INCLUDE :  target.mk
diff --git a/sal/qa/rtl/doublelock/makefile.mk b/sal/qa/rtl/doublelock/makefile.mk
index 87ef35b..214d8cb 100644
--- a/sal/qa/rtl/doublelock/makefile.mk
+++ b/sal/qa/rtl/doublelock/makefile.mk
@@ -35,7 +35,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -66,8 +68,6 @@ SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
 
 SLOFILES=$(SHL1OBJS)
 
-.ENDIF
-
 # --- Targets ------------------------------------------------------
 
 .INCLUDE :  target.mk
diff --git a/sal/qa/rtl/locale/makefile.mk b/sal/qa/rtl/locale/makefile.mk
index fd97147..984cf1a 100644
--- a/sal/qa/rtl/locale/makefile.mk
+++ b/sal/qa/rtl/locale/makefile.mk
@@ -35,7 +35,9 @@ ENABLE_EXCEPTIONS=TRUE
 
 .INCLUDE :  settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -64,8 +66,6 @@ SHL1VERSIONMAP= $(PRJ)$/qa$/export.map
 # do this here, so we get right dependencies
 # SLOFILES=$(SHL1OBJS)
 
-.ENDIF
-
 # --- Targets ------------------------------------------------------
 
 .INCLUDE :  target.mk
diff --git a/sal/qa/rtl/oustringbuffer/makefile.mk b/sal/qa/rtl/oustringbuffer/makefile.mk
index 32583c2..0db9028 100644
--- a/sal/qa/rtl/oustringbuffer/makefile.mk
+++ b/sal/qa/rtl/oustringbuffer/makefile.mk
@@ -34,7 +34,9 @@ ENABLE_EXCEPTIONS := TRUE
 
 .INCLUDE: settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -51,7 +53,5 @@ SHL1STDLIBS := $(SALLIB) $(CPPUNITLIB)
 SHL1VERSIONMAP := $(PRJ)$/qa$/export.map
 DEF1NAME := $(SHL1TARGET)
 
-.ENDIF
-
 .INCLUDE: target.mk
 .INCLUDE: $(PRJ)$/qa$/cppunit_local.mk
diff --git a/sal/qa/rtl/strings/makefile.mk b/sal/qa/rtl/strings/makefile.mk
index 821e04e..c58476e 100644
--- a/sal/qa/rtl/strings/makefile.mk
+++ b/sal/qa/rtl/strings/makefile.mk
@@ -34,7 +34,9 @@ ENABLE_EXCEPTIONS := TRUE
 
 .INCLUDE: settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 CFLAGS+= $(LFS_CFLAGS)
 CXXFLAGS+= $(LFS_CFLAGS)
@@ -52,7 +54,5 @@ SHL1STDLIBS := $(SALLIB) $(CPPUNITLIB)
 SHL1VERSIONMAP := $(PRJ)$/qa$/export.map
 DEF1NAME := $(SHL1TARGET)
 
-.ENDIF
-
 .INCLUDE: target.mk
 .INCLUDE: $(PRJ)$/qa$/cppunit_local.mk
diff --git a/sal/qa/sal/makefile.mk b/sal/qa/sal/makefile.mk
index 78c8646..0677acc 100644
--- a/sal/qa/sal/makefile.mk
+++ b/sal/qa/sal/makefile.mk
@@ -33,7 +33,9 @@ ENABLE_EXCEPTIONS := TRUE
 
 .INCLUDE: settings.mk
 
-.IF "$(CROSS_COMPILING)"!="YES"
+.IF "$(OS)" == "IOS"
+CFLAGSCXX += -DCPPUNIT_PLUGIN_EXPORTED_NAME=cppunitTest_$(TARGET)
+.ENDIF
 
 SHL1TARGET = $(TARGET)_types
 SHL1OBJS = $(SLO)$/test_types.obj
@@ -44,7 +46,5 @@ DEF1NAME = $(SHL1TARGET)
 
 SLOFILES = $(SHL1OBJS)
 
-.ENDIF
-
 .INCLUDE: target.mk
 .INCLUDE: $(PRJ)$/qa$/cppunit_local.mk
commit bfd84a6ddb9e055908b5f02826a8c2cbd815ea59
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sun Jul 10 14:38:32 2011 +0300

    No <sys/statfs.h> for iOS either

diff --git a/sal/qa/osl/file/osl_File_Const.h b/sal/qa/osl/file/osl_File_Const.h
index ed2b682..cd6f01c 100644
--- a/sal/qa/osl/file/osl_File_Const.h
+++ b/sal/qa/osl/file/osl_File_Const.h
@@ -89,7 +89,7 @@ const sal_Char pBuffer_Blank[]  = "";
 #	include <errno.h>
 #	include <fcntl.h>
 #	include <sys/stat.h>
-#   if !defined(MACOSX) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined (DRAGONFLY)
+#   if !defined(MACOSX) && !defined(IOS) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined (DRAGONFLY)
 #	    include <sys/statfs.h>
 #   else
 #       include <sys/param.h>
commit d7ba80f6189559548e7c817ebb383683c368d7bc
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sun Jul 10 14:37:36 2011 +0300

    No getVolumeInfo tests for iOS

diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 024619d..6a25539 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -5819,7 +5819,7 @@ namespace osl_Directory
             nError1 = ::osl::Directory::getVolumeInfo( aTmpName3, aVolumeInfo );
 
 // LLA: in Windows, it reply no error, it did not pass in (W32).
-#ifdef UNX
+#if defined(UNX) && !defined(IOS)
             CPPUNIT_ASSERT_MESSAGE( "test for getVolumeInfo function: non-existence test. ",
                                     ( osl::FileBase::E_NOENT == nError1 ) );
 #endif
commit cce238a499b58302b5009f7f10a6c42ace506faa
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sun Jul 10 14:36:16 2011 +0300

    iOS is much like MacOSX

diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c
index dcee27c..563aae9 100644
--- a/sal/osl/unx/nlsupport.c
+++ b/sal/osl/unx/nlsupport.c
@@ -35,13 +35,13 @@
     defined(FREEBSD) || defined(MACOSX)  || defined(IOS) || defined(OPENBSD) || \
     defined(DRAGONFLY)
 #include <pthread.h>
-#ifndef MACOSX
+#if !defined(MACOSX) && !defined(IOS)
  #include <locale.h>
  #include <langinfo.h>
 #else
 #include <osl/module.h>
 #include <osl/thread.h>
-#endif	/* !MACOSX */
+#endif	/* !MACOSX && !IOS */
 #endif	/* LINUX || SOLARIS || NETBSD || MACOSX || IOS */
 
 #include <string.h>
@@ -855,7 +855,7 @@ rtl_TextEncoding osl_getTextEncodingFromLocale( rtl_Locale * pLocale )
     return RTL_TEXTENCODING_DONTKNOW;
 }
 
-#ifdef MACOSX
+#if defined(MACOSX) || defined(IOS)
 #include "system.h"
 
 /* OS X locale discovery function */
diff --git a/sal/osl/unx/osxlocale.cxx b/sal/osl/unx/osxlocale.cxx
index 26434ef..37b34b2 100644
--- a/sal/osl/unx/osxlocale.cxx
+++ b/sal/osl/unx/osxlocale.cxx
@@ -33,7 +33,9 @@
 #include <assert.h>
 
 #include <premac.h>
+#ifndef IOS
 #include <CoreServices/CoreServices.h>
+#endif
 #include <CoreFoundation/CoreFoundation.h>
 #include <postmac.h>
 
commit 7e79b563cec10180d1e8598d2eb139ed9426bee8
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sun Jul 10 14:34:48 2011 +0300

    Add a statically linked unit tester for iOS

diff --git a/sal/prj/build.lst b/sal/prj/build.lst
index 4de7572..c0e6a8a 100644
--- a/sal/prj/build.lst
+++ b/sal/prj/build.lst
@@ -30,3 +30,4 @@ sa sal\qa\rtl\cipher nmake - all sa_qa_rtl_cipher sa_cppunittester sa_util NULL
 sa sal\qa\rtl\doublelock nmake - all sa_qa_rtl_doublelock sa_cppunittester sa_util NULL
 sa sal\qa\rtl\locale nmake - all sa_qa_rtl_locale sa_cppunittester sa_util NULL
 sa sal\qa\sal nmake - all sa_qa_sal sa_cppunittester sa_util NULL
+sa sal\qa\static nmake - u sal_qa_static sa_qa_sal NULL
diff --git a/sal/qa/static/makefile.mk b/sal/qa/static/makefile.mk
new file mode 100644
index 0000000..c76cf40
--- /dev/null
+++ b/sal/qa/static/makefile.mk
@@ -0,0 +1,63 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+PRJ = ../..
+PRJNAME = sal
+TARGET = sal_cppunittester_all
+
+ENABLE_EXCEPTIONS = TRUE
+LIBTARGET = NO
+
+.INCLUDE: settings.mk
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
+.IF "$(OS)" != "IOS"
+
+ALL :
+    @echo This is only for iOS
+
+.ENDIF
+
+CFLAGSCXX += -x objective-c++ -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300
+
+OBJFILES = $(APP1OBJS)
+
+APP1OBJS = $(OBJ)/sal_cppunittester_all.obj
+APP1RPATH = NONE
+APP1LIBS += \
+    $(SLB)/qa_ByteSequence.lib \
+    $(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)
+APP1TARGET = $(TARGET)
+
+.INCLUDE: target.mk
diff --git a/sal/qa/static/sal_cppunittester_all.cxx b/sal/qa/static/sal_cppunittester_all.cxx
new file mode 100644
index 0000000..b5ead71
--- /dev/null
+++ b/sal/qa/static/sal_cppunittester_all.cxx
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org.  If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_sal.hxx"
+#include "sal/config.h"
+
+#include <cstdlib>
+#include <iostream>
+#include <limits>
+#include <string>
+#include "cppunittester/protectorfactory.hxx"
+#include "osl/module.h"
+#include "osl/module.hxx"
+#include "osl/thread.h"
+#include "rtl/process.h"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/textcvt.h"
+#include "rtl/ustring.hxx"
+#include "sal/main.h"
+#include "sal/types.h"
+
+#include "cppunit/CompilerOutputter.h"
+#include "cppunit/TestResult.h"
+#include "cppunit/TestResultCollector.h"
+#include "cppunit/TestRunner.h"
+#include "cppunit/extensions/TestFactoryRegistry.h"
+#include "cppunit/portability/Stream.h"
+
+#include "boost/noncopyable.hpp"
+
+namespace {
+
+void usageFailure() {
+    std::cerr
+        << ("Usage: cppunittester (--protector <shared-library-path>"
+            " <function-symbol>)* <shared-library-path>")
+        << std::endl;
+    std::exit(EXIT_FAILURE);
+}
+
+rtl::OUString getArgument(sal_Int32 index) {
+    rtl::OUString arg;
+    rtl_getAppCommandArg(index, &arg.pData);
+    return arg;
+}
+
+std::string convertLazy(rtl::OUString const & s16) {
+    rtl::OString s8(rtl::OUStringToOString(s16, osl_getThreadTextEncoding()));
+    return std::string(
+        s8.getStr(),
+        ((static_cast< sal_uInt32 >(s8.getLength())
+          > (std::numeric_limits< std::string::size_type >::max)())
+         ? (std::numeric_limits< std::string::size_type >::max)()
+         : static_cast< std::string::size_type >(s8.getLength())));
+}
+
+//Allow the whole uniting testing framework to be run inside a "Protector"
+//which knows about uno exceptions, so it can print the content of the
+//exception before falling over and dying
+class CPPUNIT_API ProtectedFixtureFunctor : public CppUnit::Functor, private boost::noncopyable
+{
+private:
+    const std::string &args;
+    CppUnit::TestResult &result;
+public:
+    ProtectedFixtureFunctor(const std::string &args_, CppUnit::TestResult &result_)
+        : args(args_)
+        , result(result_)
+    {
+    }
+    bool run() const
+    {
+        CppUnit::TestRunner runner;
+        runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
+        CppUnit::TestResultCollector collector;
+        result.addListener(&collector);
+        runner.run(result);
+        CppUnit::CompilerOutputter(&collector, CppUnit::stdCErr()).write();
+        return collector.wasSuccessful();
+    }
+    virtual bool operator()() const
+    {
+        return run();
+    }
+};
+}
+
+SAL_IMPLEMENT_MAIN() {
+    CppUnit::TestResult result;
+    cppunittester::LibreOfficeProtector *throw_protector = 0;
+    std::string args;
+    sal_uInt32 index = 0;
+    bool ok = false;
+    ProtectedFixtureFunctor tests(args, result);
+    ok = tests.run();
+
+    return ok ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 4392b6ad246b7c54aad1da8155271932f012cbc2
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sun Jul 10 14:24:45 2011 +0300

    aTestSec is not used anywhere

diff --git a/sal/qa/osl/security/osl_Security_Const.h b/sal/qa/osl/security/osl_Security_Const.h
index 74e068e..9298324 100644
--- a/sal/qa/osl/security/osl_Security_Const.h
+++ b/sal/qa/osl/security/osl_Security_Const.h
@@ -63,7 +63,6 @@ const char pTestString[17] = "Sun Microsystems";
 //------------------------------------------------------------------------
 // condition names
 //------------------------------------------------------------------------
-OSLTEST_DECLARE_USTRING( TestSec,  "testsecurity" );
 OSLTEST_DECLARE_USTRING( NullURL,  "" );
 
 ::rtl::OUString aLogonUser( aNullURL ), aLogonPasswd( aNullURL ), aFileServer( aNullURL ), aStringForward( aNullURL );
commit ec098ad49f7a4945817c5310f2d250ab13fc85ca
Author: Tor Lillqvist <tml at iki.fi>
Date:   Sun Jul 10 12:39:25 2011 +0300

    Don't run cppunittester automatically when cross-compiling

diff --git a/sal/qa/cppunit_local.mk b/sal/qa/cppunit_local.mk
index 4b452b7..eaa6628 100644
--- a/sal/qa/cppunit_local.mk
+++ b/sal/qa/cppunit_local.mk
@@ -25,6 +25,10 @@
 
 # cppunittester is built in this module; cannot use delivered version
 # this should be kept in sync with the definition in solenv/inc/settings.mk
+.IF "$(CROSS_COMPILING)"=="YES"
+CPPUNITTESTER=\#
+.ELSE
 CPPUNITTESTER = $(AUGMENT_LIBRARY_PATH_LOCAL) $(GDBCPPUNITTRACE) $(VALGRINDTOOL) $(BIN)/cppunittester
+.ENDIF
 
 .INCLUDE : _cppunit.mk


More information about the Libreoffice-commits mailing list