split 'test' into 'unotest' and 'test' to help dependencies

This commit is contained in:
Michael Meeks
2011-09-28 15:48:09 +01:00
parent f29109cc5b
commit d0edcf0a55
37 changed files with 315 additions and 37 deletions

View File

@@ -282,6 +282,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
sofficeapp \ sofficeapp \
store \ store \
test \ test \
unotest \
textconv_dict \ textconv_dict \
ucb \ ucb \
ucpfile \ ucpfile \

View File

@@ -59,12 +59,9 @@ $(eval $(call gb_CppunitTest_add_service_rdbs,i18npool_test_breakiterator,\
i18npool_test_breakiterator \ i18npool_test_breakiterator \
)) ))
# $(eval $(call gb_CppunitTest_set_args,i18npool_test_breakiterator,\
# Disable for now - to break circular dependency ... --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
# ))
# $(eval $(call gb_CppunitTest_set_args,i18npool_test_breakiterator,\
# --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
# ))
$(eval $(call gb_RdbTarget_RdbTarget,i18npool_test_breakiterator)) $(eval $(call gb_RdbTarget_RdbTarget,i18npool_test_breakiterator))

View File

@@ -1,2 +1,2 @@
inp i18npool : bridges sax stoc comphelper CPPUNIT:cppunit ICU:icu i18nutil regexp DESKTOP:cpputools LIBXSLT:libxslt udkapi ure NULL inp i18npool : bridges sax stoc comphelper CPPUNIT:cppunit ICU:icu i18nutil regexp DESKTOP:cpputools LIBXSLT:libxslt udkapi ure unotest NULL
inp i18npool\prj nmake - all inp_prj NULL inp i18npool\prj nmake - all inp_prj NULL

View File

@@ -310,6 +310,7 @@ LPSOLVELIB=-llpsolve55
SOFFICELIB=-lsofficeapp SOFFICELIB=-lsofficeapp
UNOPKGAPPLIB=-lunopkgapp UNOPKGAPPLIB=-lunopkgapp
TESTLIB=-ltest TESTLIB=-ltest
UNOTESTLIB=-lunotest
XMLREADERLIB=-lxmlreader XMLREADERLIB=-lxmlreader
.IF "$(OS)" == "IOS" .IF "$(OS)" == "IOS"
@@ -522,6 +523,7 @@ LPSOLVELIB=lpsolve55.lib
SOFFICELIB=isofficeapp.lib SOFFICELIB=isofficeapp.lib
UNOPKGAPPLIB=iunopkgapp.lib UNOPKGAPPLIB=iunopkgapp.lib
TESTLIB=itest.lib TESTLIB=itest.lib
UNOTESTLIB=iunotest.lib
BOOSTTHREADLIB=boostthread.lib BOOSTTHREADLIB=boostthread.lib
XMLREADERLIB=ixmlreader.lib XMLREADERLIB=ixmlreader.lib

View File

@@ -1,6 +1,2 @@
te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offapi ridljar sal solenv stlport unoil qadevOOo vcl NULL te test : unotest vcl NULL
te test\inc nmake - all inc NULL
te test\source\cpp nmake - all source_cpp inc NULL te test\source\cpp nmake - all source_cpp inc NULL
te test\source\cpp\unoexceptionprotector nmake - all source_cpp_unoexceptionprotector inc NULL
te test\source\java\org\openoffice\test nmake - all source_java NULL
te test\source\java\org\openoffice\test\tools nmake - all source_java_tools NULL

View File

@@ -1,19 +1,8 @@
mkdir: %_DEST%\inc\test mkdir: %_DEST%\inc\test
mkdir: %_DEST%\inc\test\detail
..\%__SRC%\bin\test.dll %_DEST%\bin\test.dll ..\%__SRC%\bin\test.dll %_DEST%\bin\test.dll
..\%__SRC%\bin\unoexceptionprotector.dll %_DEST%\bin\unoexceptionprotector.dll
..\%__SRC%\lib\itest.lib %_DEST%\lib\itest.lib ..\%__SRC%\lib\itest.lib %_DEST%\lib\itest.lib
..\%__SRC%\lib\libtest.dylib %_DEST%\lib\libtest.dylib ..\%__SRC%\lib\libtest.dylib %_DEST%\lib\libtest.dylib
..\%__SRC%\lib\libtest.so %_DEST%\lib\libtest.so ..\%__SRC%\lib\libtest.so %_DEST%\lib\libtest.so
..\%__SRC%\lib\libtest.dll.a %_DEST%\lib\libtest.dll.a ..\%__SRC%\lib\libtest.dll.a %_DEST%\lib\libtest.dll.a
..\%__SRC%\lib\unoexceptionprotector.dylib %_DEST%\lib\unoexceptionprotector.dylib
..\%__SRC%\lib\unoexceptionprotector.so %_DEST%\lib\unoexceptionprotector.so
..\inc\test\detail\testdllapi.hxx %_DEST%\inc\test\detail\testdllapi.hxx ..\inc\test\detail\testdllapi.hxx %_DEST%\inc\test\detail\testdllapi.hxx
..\inc\test\gettestargument.hxx %_DEST%\inc\test\gettestargument.hxx
..\inc\test\officeconnection.hxx %_DEST%\inc\test\officeconnection.hxx
..\inc\test\bootstrapfixture.hxx %_DEST%\inc\test\bootstrapfixture.hxx ..\inc\test\bootstrapfixture.hxx %_DEST%\inc\test\bootstrapfixture.hxx
..\inc\test\oustringostreaminserter.hxx %_DEST%\inc\test\oustringostreaminserter.hxx
..\inc\test\toabsolutefileurl.hxx %_DEST%\inc\test\toabsolutefileurl.hxx
..\inc\test\uniquepipename.hxx %_DEST%\inc\test\uniquepipename.hxx
..\%__SRC%\class\test.jar %_DEST%\bin\test.jar
..\%__SRC%\class\test-tools.jar %_DEST%\bin\test-tools.jar

View File

@@ -38,12 +38,7 @@ CDEFS += -DOOO_DLLIMPLEMENTATION_TEST
CFLAGSCXX += $(CPPUNIT_CFLAGS) CFLAGSCXX += $(CPPUNIT_CFLAGS)
SLOFILES = \ SLOFILES = \
$(SLO)/getargument.obj \ $(SLO)/bootstrapfixture.obj
$(SLO)/gettestargument.obj \
$(SLO)/bootstrapfixture.obj \
$(SLO)/officeconnection.obj \
$(SLO)/toabsolutefileurl.obj \
$(SLO)/uniquepipename.obj
.IF "$(CROSS_COMPILING)" == "YES" .IF "$(CROSS_COMPILING)" == "YES"
SHL1IMPLIB = $(SHL1TARGET) SHL1IMPLIB = $(SHL1TARGET)

View File

@@ -24,9 +24,17 @@
* for a copy of the LGPLv3 License. * for a copy of the LGPLv3 License.
************************************************************************/ ************************************************************************/
#if defined PRECOMPILED_HEADERS #ifndef INCLUDED_UNOTEST_DETAIL_UNOTESTDLLAPI_HXX
#define INCLUDED_UNOTEST_DETAIL_UNOTESTDLLAPI_HXX
#include "sal/config.h" #include "sal/config.h"
#include "sal/types.h"
#if defined OOO_DLLIMPLEMENTATION_UNOTEST
#define OOO_DLLPUBLIC_UNOTEST SAL_DLLPUBLIC_EXPORT
#else
#define OOO_DLLPUBLIC_UNOTEST SAL_DLLPUBLIC_IMPORT
#endif
#endif #endif

View File

@@ -0,0 +1,49 @@
/* -*- 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.
*
************************************************************************/
#ifndef INCLUDED_TEST_GETTESTARGUMENT_HXX
#define INCLUDED_TEST_GETTESTARGUMENT_HXX
#include "sal/config.h"
#include "test/detail/testdllapi.hxx"
namespace rtl { class OUString; }
namespace test {
// Obtain the value of a test argument (tunneled in via an "arg-testarg.<name>"
// bootstrap variable):
OOO_DLLPUBLIC_TEST bool getTestArgument(
rtl::OUString const & name, rtl::OUString * value);
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -0,0 +1,71 @@
/* -*- 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.
************************************************************************/
#ifndef INCLUDED_TEST_OFFICECONNECTION_HXX
#define INCLUDED_TEST_OFFICECONNECTION_HXX
#include "sal/config.h"
#include "boost/noncopyable.hpp"
#include "com/sun/star/uno/Reference.hxx"
#include "osl/process.h"
#include "test/detail/testdllapi.hxx"
namespace com { namespace sun { namespace star { namespace uno {
class XComponentContext;
} } } }
namespace test {
// Start up and shut down an OOo instance (details about the OOo instance are
// tunneled in via "arg-..." bootstrap variables):
class OOO_DLLPUBLIC_TEST OfficeConnection: private boost::noncopyable {
public:
OfficeConnection();
~OfficeConnection();
void setUp();
void tearDown();
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
getComponentContext() const;
// Must not be called before setUp or after tearDown:
bool isStillAlive() const;
private:
oslProcess process_;
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
context_;
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -0,0 +1,51 @@
/* -*- 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.
************************************************************************/
#ifndef INCLUDED_TEST_OUSTRINGOSTREAMINSERTER_HXX
#define INCLUDED_TEST_OUSTRINGOSTREAMINSERTER_HXX
#include "sal/config.h"
#include <ostream>
#include "osl/thread.h"
#include "rtl/ustring.hxx"
// Include this header to support rtl::OUString in CPPUNIT_ASSERT macros.
template< typename charT, typename traits > std::basic_ostream<charT, traits> &
operator <<(
std::basic_ostream<charT, traits> & stream, rtl::OUString const & string)
{
return stream <<
rtl::OUStringToOString(string, osl_getThreadTextEncoding()).getStr();
// best effort; potentially loses data due to conversion failures and
// embedded null characters
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -0,0 +1,47 @@
/* -*- 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.
************************************************************************/
#ifndef INCLUDED_TEST_TOABSOLUTEFILEURL_HXX
#define INCLUDED_TEST_TOABSOLUTEFILEURL_HXX
#include "sal/config.h"
#include "unotest/detail/unotestdllapi.hxx"
namespace rtl { class OUString; }
namespace test {
// Convert a pathname in system notation, potentially relative to the process's
// current working directory, to an absolute file URL:
OOO_DLLPUBLIC_UNOTEST rtl::OUString toAbsoluteFileUrl(
rtl::OUString const & relativePathname);
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -1,5 +1,6 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/************************************************************************* /*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* Copyright 2000, 2010 Oracle and/or its affiliates. * Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -22,8 +23,25 @@
* version 3 along with OpenOffice.org. If not, see * version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html> * <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License. * for a copy of the LGPLv3 License.
*
************************************************************************/ ************************************************************************/
#include "precompiled_test.hxx" #ifndef INCLUDED_TEST_UNIQUEPIPENAME_HXX
#define INCLUDED_TEST_UNIQUEPIPENAME_HXX
#include "sal/config.h"
#include "test/detail/testdllapi.hxx"
namespace rtl { class OUString; }
namespace test {
// Create a system-wide unique name (for use with osl::Pipe):
OOO_DLLPUBLIC_TEST rtl::OUString uniquePipeName(rtl::OUString const & name);
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

5
unotest/prj/build.lst Normal file
View File

@@ -0,0 +1,5 @@
unote unotest : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offapi ridljar sal solenv stlport unoil qadevOOo vcl NULL
unote unotest\source\cpp nmake - all source_cpp inc NULL
unote unotest\source\cpp\unoexceptionprotector nmake - all source_cpp_unoexceptionprotector inc NULL
unote unotest\source\java\org\openoffice\test nmake - all source_java NULL
unote unotest\source\java\org\openoffice\test\tools nmake - all source_java_tools NULL

18
unotest/prj/d.lst Normal file
View File

@@ -0,0 +1,18 @@
mkdir: %_DEST%\inc\unotest
mkdir: %_DEST%\inc\unotest\detail
..\%__SRC%\bin\unotest.dll %_DEST%\bin\unotest.dll
..\%__SRC%\bin\unoexceptionprotector.dll %_DEST%\bin\unoexceptionprotector.dll
..\%__SRC%\lib\iunotest.lib %_DEST%\lib\iunotest.lib
..\%__SRC%\lib\libunotest.dylib %_DEST%\lib\libunotest.dylib
..\%__SRC%\lib\libunotest.so %_DEST%\lib\libunotest.so
..\%__SRC%\lib\libunotest.dll.a %_DEST%\lib\libunotest.dll.a
..\%__SRC%\lib\unoexceptionprotector.dylib %_DEST%\lib\unoexceptionprotector.dylib
..\%__SRC%\lib\unoexceptionprotector.so %_DEST%\lib\unoexceptionprotector.so
..\inc\unotest\detail\unotestdllapi.hxx %_DEST%\inc\unotest\detail\unotestdllapi.hxx
..\inc\unotest\gettestargument.hxx %_DEST%\inc\unotest\gettestargument.hxx
..\inc\unotest\officeconnection.hxx %_DEST%\inc\unotest\officeconnection.hxx
..\inc\unotest\oustringostreaminserter.hxx %_DEST%\inc\unotest\oustringostreaminserter.hxx
..\inc\unotest\toabsolutefileurl.hxx %_DEST%\inc\unotest\toabsolutefileurl.hxx
..\inc\unotest\uniquepipename.hxx %_DEST%\inc\unotest\uniquepipename.hxx
..\%__SRC%\class\test.jar %_DEST%\bin\test.jar
..\%__SRC%\class\test-tools.jar %_DEST%\bin\test-tools.jar

View File

@@ -23,16 +23,47 @@
# for a copy of the LGPLv3 License. # for a copy of the LGPLv3 License.
#***********************************************************************/ #***********************************************************************/
PRJ = .. PRJ = ../..
PRJNAME = test PRJNAME = unotest
TARGET = inc TARGET = cpp
ENABLE_EXCEPTIONS = TRUE ENABLE_EXCEPTIONS = TRUE
VISIBILITY_HIDDEN = TRUE VISIBILITY_HIDDEN = TRUE
.INCLUDE: settings.mk .INCLUDE: settings.mk
.INCLUDE: target.mk
.IF "$(ENABLE_PCH)" != "" # --- Files --------------------------------------------------------
ALLTAR: $(SLO)/precompiled.pch $(SLO)/precompiled_ex.pch CDEFS += -DOOO_DLLIMPLEMENTATION_UNOTEST
CFLAGSCXX += $(CPPUNIT_CFLAGS)
SLOFILES = \
$(SLO)/getargument.obj \
$(SLO)/gettestargument.obj \
$(SLO)/bootstrapfixture.obj \
$(SLO)/officeconnection.obj \
$(SLO)/toabsolutefileurl.obj \
$(SLO)/uniquepipename.obj
.IF "$(CROSS_COMPILING)" == "YES"
SHL1IMPLIB = $(SHL1TARGET)
.ELSE
SHL1IMPLIB = i$(SHL1TARGET)
.ENDIF .ENDIF
SHL1OBJS = $(SLOFILES)
SHL1RPATH = NONE
SHL1STDLIBS = \
$(VCLLIB) \
$(TOOLSLIB) \
$(UCBHELPERLIB) \
$(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
$(UNOTOOLSLIB) \
$(CPPULIB) \
$(CPPUNITLIB) \
$(SALLIB)
SHL1TARGET = test
SHL1USE_EXPORTS = name
DEF1NAME = $(SHL1TARGET)
.INCLUDE: target.mk