svn commit: r1701062 - in /openoffice/trunk/main/sal/qa/testHelperFunctions: makefile.mk testHelperFunctions.cxx testHelperFunctions2.cxx
Author: damjan Date: Thu Sep 3 16:25:13 2015 New Revision: 1701062 URL: http://svn.apache.org/r1701062 Log: #i125003# migrate main/sal/qa/testHelperFunctions from cppunit to Google Test. Modified: openoffice/trunk/main/sal/qa/testHelperFunctions/makefile.mk openoffice/trunk/main/sal/qa/testHelperFunctions/testHelperFunctions.cxx openoffice/trunk/main/sal/qa/testHelperFunctions/testHelperFunctions2.cxx Modified: openoffice/trunk/main/sal/qa/testHelperFunctions/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/testHelperFunctions/makefile.mk?rev=1701062=1701061=1701062=diff == --- openoffice/trunk/main/sal/qa/testHelperFunctions/makefile.mk (original) +++ openoffice/trunk/main/sal/qa/testHelperFunctions/makefile.mk Thu Sep 3 16:25:13 2015 @@ -32,28 +32,29 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(ENABLE_UNIT_TESTS)" != "YES" +all: + @echo unit tests are disabled. Nothing to do. + +.ELSE + CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) # --- BEGIN -SHL1OBJS= \ +APP1OBJS= \ $(SLO)$/testHelperFunctions.obj \ $(SLO)$/testHelperFunctions2.obj -SHL1TARGET= testHelperFunctions -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) - -SHL1IMPLIB= i$(SHL1TARGET) -DEF1NAME=$(SHL1TARGET) -SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +APP1TARGET= testHelperFunctions +APP1STDLIBS= $(SALLIB) $(GTESTLIB) $(TESTSHL2LIB) +APP1RPATH = NONE +APP1TEST = enabled # END -- -#--- All object files --- -# do this here, so we get right dependencies -# SLOFILES=$(SHL1OBJS) - # --- Targets -- .INCLUDE : target.mk -.INCLUDE : _cppunit.mk + +.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES" Modified: openoffice/trunk/main/sal/qa/testHelperFunctions/testHelperFunctions.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/testHelperFunctions/testHelperFunctions.cxx?rev=1701062=1701061=1701062=diff == --- openoffice/trunk/main/sal/qa/testHelperFunctions/testHelperFunctions.cxx (original) +++ openoffice/trunk/main/sal/qa/testHelperFunctions/testHelperFunctions.cxx Thu Sep 3 16:25:13 2015 @@ -31,19 +31,19 @@ #include "stringhelper.hxx" -#include +#include "gtest/gtest.h" // void isJaBloed() // { -// t_print("Ist ja echt bloed.\n"); +// printf("Ist ja echt bloed.\n"); // } inline sal_Int64 t_abs64(sal_Int64 _nValue) { // std::abs() seems to have some ambiguity problems (so-texas) // return abs(_nValue); -t_print("t_abs64(%ld)\n", _nValue); -// CPPUNIT_ASSERT(_nValue < 2147483647); +printf("t_abs64(%ld)\n", _nValue); +// ASSERT_TRUE(_nValue < 2147483647); if (_nValue < 0) { @@ -52,7 +52,7 @@ inline sal_Int64 t_abs64(sal_Int64 _nVal return _nValue; } -void t_print64(sal_Int64 n) +void printf64(sal_Int64 n) { if (n < 0) { @@ -79,146 +79,123 @@ void t_print64(sal_Int64 n) // - namespace testOfHelperFunctions { -class test_t_abs64 : public CppUnit::TestFixture +class test_t_abs64 : public ::testing::Test { -public: -void test0(); -void test1_0(); -void test1(); -void test1_1(); -void test2(); -void test3(); -void test4(); - -CPPUNIT_TEST_SUITE( test_t_abs64 ); -CPPUNIT_TEST( test0 ); -CPPUNIT_TEST( test1_0 ); -CPPUNIT_TEST( test1 ); -CPPUNIT_TEST( test1_1 ); -CPPUNIT_TEST( test2 ); -CPPUNIT_TEST( test3 ); -CPPUNIT_TEST( test4 ); -CPPUNIT_TEST_SUITE_END( ); }; -void test_t_abs64::test0() +TEST_F(test_t_abs64, test0) { // this values has an overrun! sal_Int32 n32 = 2147483648; -t_print("n32 should be -2^31 is: %d\n", n32); -CPPUNIT_ASSERT_MESSAGE("n32!=2147483648", n32 == -2147483648 ); +printf("n32 should be -2^31 is: %d\n", n32); +ASSERT_TRUE(n32 == -2147483648 ) << "n32!=2147483648"; } -void test_t_abs64::test1_0() +TEST_F(test_t_abs64,test1_0) { sal_Int64 n; n = 1073741824; n <<= 9; -t_print("Value of n is "); -t_print64(n); -CPPUNIT_ASSERT_MESSAGE("n=2^30 << 9", t_abs64(n) > 0 ); +printf("Value of n is "); +printf64(n); +ASSERT_TRUE(t_abs64(n) > 0) << "n=2^30 << 9"; } -void test_t_abs64::test1() +TEST_F(test_t_abs64, test1) { sal_Int64 n; n = 2147483648 << 8; -t_print("Value of n is "); -t_print64(n); -CPPUNIT_ASSERT_MESSAGE("n=2^31 <<
svn commit: r1701078 - in /openoffice/trunk/main/sal/qa/osl/mutex: makefile.mk osl_Mutex.cxx
Author: damjan Date: Thu Sep 3 17:09:00 2015 New Revision: 1701078 URL: http://svn.apache.org/r1701078 Log: #i125003# migrate main/sal/qa/osl/mutex from cppunit to Google Test. Modified: openoffice/trunk/main/sal/qa/osl/mutex/makefile.mk openoffice/trunk/main/sal/qa/osl/mutex/osl_Mutex.cxx Modified: openoffice/trunk/main/sal/qa/osl/mutex/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/osl/mutex/makefile.mk?rev=1701078=1701077=1701078=diff == --- openoffice/trunk/main/sal/qa/osl/mutex/makefile.mk (original) +++ openoffice/trunk/main/sal/qa/osl/mutex/makefile.mk Thu Sep 3 17:09:00 2015 @@ -36,34 +36,34 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(ENABLE_UNIT_TESTS)" != "YES" +all: + @echo unit tests are disabled. Nothing to do. + +.ELSE + CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) -CFLAGSCXX += $(CPPUNIT_CFLAGS) - # BEGIN # auto generated Target:Socket by codegen.pl -SHL1OBJS= \ +APP1OBJS= \ $(SLO)$/osl_Mutex.obj -SHL1TARGET= osl_Mutex -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) +APP1TARGET= osl_Mutex +APP1STDLIBS= $(SALLIB) $(GTESTLIB) .IF "$(GUI)" == "WNT" -SHL1STDLIBS += $(WS2_32LIB) +APP1STDLIBS += $(WS2_32LIB) .ENDIF - -SHL1IMPLIB= i$(SHL1TARGET) - -DEF1NAME=$(SHL1TARGET) -SHL1VERSIONMAP = $(PRJ)$/qa$/export.map -SHL1RPATH = NONE - +APP1RPATH = NONE +APP1TEST = enabled # auto generated Target:Socket # END -- # --- Targets -- .INCLUDE : target.mk -.INCLUDE : _cppunit.mk + +.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES" .END Modified: openoffice/trunk/main/sal/qa/osl/mutex/osl_Mutex.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/osl/mutex/osl_Mutex.cxx?rev=1701078=1701077=1701078=diff == --- openoffice/trunk/main/sal/qa/osl/mutex/osl_Mutex.cxx (original) +++ openoffice/trunk/main/sal/qa/osl/mutex/osl_Mutex.cxx Thu Sep 3 17:09:00 2015 @@ -27,10 +27,7 @@ // // include files // -#include "cppunit/TestAssert.h" -#include "cppunit/TestFixture.h" -#include "cppunit/extensions/HelperMacros.h" -#include "cppunit/plugin/TestPlugIn.h" +#include "gtest/gtest.h" #include using namespaceosl; @@ -114,7 +111,7 @@ public: ~IncreaseThread( ) { - CPPUNIT_ASSERT_MESSAGE( "#IncreaseThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); + ASSERT_TRUE(sal_False == this -> isRunning( )) << "#IncreaseThread does not shutdown properly.\n"; } protected: struct resource *pResource; @@ -142,7 +139,7 @@ public: ~DecreaseThread( ) { - CPPUNIT_ASSERT_MESSAGE( "#DecreaseThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); + ASSERT_TRUE(sal_False == this -> isRunning( )) << "#DecreaseThread does not shutdown properly.\n"; } protected: struct resource *pResource; @@ -180,7 +177,7 @@ public: ~PutThread( ) { - CPPUNIT_ASSERT_MESSAGE( "#PutThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); + ASSERT_TRUE(sal_False == this -> isRunning( )) << "#PutThread does not shutdown properly.\n"; } protected: struct chain* pChain; @@ -218,7 +215,7 @@ public: ~HoldThread( ) { - CPPUNIT_ASSERT_MESSAGE( "#HoldThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); + ASSERT_TRUE(sal_False == this -> isRunning( )) << "#HoldThread does not shutdown properly.\n"; } protected: Mutex* pMyMutex; @@ -240,7 +237,7 @@ public: ~WaitThread( ) { - CPPUNIT_ASSERT_MESSAGE( "#WaitThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); + ASSERT_TRUE(sal_False == this -> isRunning( )) << "#WaitThread does not shutdown properly.\n"; } protected: Mutex* pMyMutex; @@ -264,7 +261,7 @@ public: ~GlobalMutexThread( ) { - CPPUNIT_ASSERT_MESSAGE( "#GlobalMutexThread does not shutdown properly.\n", sal_False == this -> isRunning( ) ); + ASSERT_TRUE(sal_False == this -> isRunning( )) << "#GlobalMutexThread does not shutdown properly.\n"; } protected: void SAL_CALL run( ) @@ -285,14 +282,14 @@ namespace osl_Mutex /** Test of the osl::Mutex::constructor */ - class ctor : public CppUnit::TestFixture + class
svn commit: r1701079 - in /openoffice/trunk/main/sal/qa/osl/setthreadname: makefile.mk test-setthreadname.cxx
Author: damjan Date: Thu Sep 3 17:11:28 2015 New Revision: 1701079 URL: http://svn.apache.org/r1701079 Log: #i125003# migrate main/sal/qa/osl/setthreadname from cppunit to Google Test. Modified: openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx Modified: openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk?rev=1701079=1701078=1701079=diff == --- openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk (original) +++ openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk Thu Sep 3 17:11:28 2015 @@ -33,21 +33,20 @@ ENABLE_EXCEPTIONS = TRUE .INCLUDE: settings.mk -CFLAGSCXX += $(CPPUNIT_CFLAGS) - -DLLPRE = - -SHL1IMPLIB = i$(SHL1TARGET) -SHL1OBJS = $(SLO)/test-setthreadname.obj -SHL1RPATH = NONE -SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB) -SHL1TARGET = test-setthreadname -SHL1VERSIONMAP = version.map -DEF1NAME = $(SHL1TARGET) - -SLOFILES = $(SHL1OBJS) +.IF "$(ENABLE_UNIT_TESTS)" != "YES" +all: + @echo unit tests are disabled. Nothing to do. + +.ELSE + +APP1OBJS = $(SLO)/test-setthreadname.obj +APP1RPATH = NONE +APP1STDLIBS = $(GTESTLIB) $(SALLIB) +APP1TARGET = test-setthreadname +APP1TEST = enabled .INCLUDE: target.mk -.INCLUDE: _cppunit.mk + +.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES" .END Modified: openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx?rev=1701079=1701078=1701079=diff == --- openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx (original) +++ openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx Thu Sep 3 17:11:28 2015 @@ -29,10 +29,7 @@ #include #include "boost/noncopyable.hpp" -#include "cppunit/TestAssert.h" -#include "cppunit/TestFixture.h" -#include "cppunit/extensions/HelperMacros.h" -#include "cppunit/plugin/TestPlugIn.h" +#include "gtest/gtest.h" #include "osl/thread.hxx" namespace { @@ -61,23 +58,20 @@ void TestThread::run() { } } -class Test: public CppUnit::TestFixture { -private: -CPPUNIT_TEST_SUITE(Test); -CPPUNIT_TEST(test); -CPPUNIT_TEST_SUITE_END(); - -void test(); +class Test: public ::testing::Test { }; -void Test::test() { +TEST_F(Test, test) { TestThread t; t.create(); t.join(); } -CPPUNIT_TEST_SUITE_REGISTRATION(Test); } -CPPUNIT_PLUGIN_IMPLEMENT(); +int main(int argc, char **argv) +{ +::testing::InitGoogleTest(, argv); +return RUN_ALL_TESTS(); +}
svn commit: r1701084 - in /openoffice/trunk/main/sax/qa/cppunit: makefile.mk test_converter.cxx
Author: damjan Date: Thu Sep 3 17:35:52 2015 New Revision: 1701084 URL: http://svn.apache.org/r1701084 Log: #i125003# migrate main/sax/qa/cppunit from cppunit to Google Test. Modified: openoffice/trunk/main/sax/qa/cppunit/makefile.mk openoffice/trunk/main/sax/qa/cppunit/test_converter.cxx Modified: openoffice/trunk/main/sax/qa/cppunit/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sax/qa/cppunit/makefile.mk?rev=1701084=1701083=1701084=diff == --- openoffice/trunk/main/sax/qa/cppunit/makefile.mk (original) +++ openoffice/trunk/main/sax/qa/cppunit/makefile.mk Thu Sep 3 17:35:52 2015 @@ -31,50 +31,30 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -.IF "$(WITH_CPPUNIT)" != "YES" +.IF "$(ENABLE_UNIT_TESTS)" != "YES" +all: + @echo unit tests are disabled. Nothing to do. -@all: - @echo "cppunit disabled. nothing do do." - -.ELSE # "$(WITH_CPPUNIT)" != "YES" - -CFLAGSCXX += $(CPPUNIT_CFLAGS) -DLLPRE = # no leading "lib" on .so files +.ELSE # "$(ENABLE_UNIT_TESTS)" != "YES" # --- Libs - -SHL1OBJS= \ - $(SLO)/test_converter.obj \ - - -SHL1STDLIBS= \ -$(SAXLIB) \ -$(SALLIB) \ -$(CPPUNITLIB) \ - - +APP1OBJS= \ + $(SLO)/test_converter.obj +APP1STDLIBS= \ + $(SAXLIB) \ + $(SALLIB) \ + $(GTESTLIB) .IF "$(GUI)" == "OS2" -SHL1TARGET= tst_cnv +APP1TARGET= tst_cnv .ELSE -SHL1TARGET= test_converter +APP1TARGET= test_converter .ENDIF -SHL1RPATH = NONE -SHL1IMPLIB= i$(SHL1TARGET) -# SHL1DEF= $(MISC)/$(SHL1TARGET).def -DEF1NAME=$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp -SHL1VERSIONMAP= version.map - -# --- All object files - - -SLOFILES= \ - $(SHL1OBJS) \ - +APP1RPATH = NONE +APP1TEST = enabled # --- Targets -- -.ENDIF # "$(WITH_CPPUNIT)" != "YES" - .INCLUDE : target.mk -.INCLUDE : _cppunit.mk +.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES" Modified: openoffice/trunk/main/sax/qa/cppunit/test_converter.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sax/qa/cppunit/test_converter.cxx?rev=1701084=1701083=1701084=diff == --- openoffice/trunk/main/sax/qa/cppunit/test_converter.cxx (original) +++ openoffice/trunk/main/sax/qa/cppunit/test_converter.cxx Thu Sep 3 17:35:52 2015 @@ -22,10 +22,7 @@ #include "preextstl.h" -#include -#include -#include -#include +#include "gtest/gtest.h" #include "postextstl.h" #include @@ -44,28 +41,18 @@ using sax::Converter; namespace { class ConverterTest -: public ::CppUnit::TestFixture +: public ::testing::Test { public: -virtual void setUp(); -virtual void tearDown(); - -void testDuration(); -void testDateTime(); - -CPPUNIT_TEST_SUITE(ConverterTest); -CPPUNIT_TEST(testDuration); -CPPUNIT_TEST(testDateTime); -CPPUNIT_TEST_SUITE_END(); - -private: +virtual void SetUp(); +virtual void TearDown(); }; -void ConverterTest::setUp() +void ConverterTest::SetUp() { } -void ConverterTest::tearDown() +void ConverterTest::TearDown() { } @@ -87,13 +74,13 @@ static void doTest(util::Duration const OSL_TRACE("%d %dY %dM %dD %dH %dM %dS %dm", od.Negative, od.Years, od.Months, od.Days, od.Hours, od.Minutes, od.Seconds, od.MilliSeconds); -CPPUNIT_ASSERT(bSuccess); -CPPUNIT_ASSERT(eqDuration(rid, od)); +ASSERT_TRUE(bSuccess); +ASSERT_TRUE(eqDuration(rid, od)); ::rtl::OUStringBuffer buf; Converter::convertDuration(buf, od); OSL_TRACE( ::rtl::OUStringToOString(buf.getStr(), RTL_TEXTENCODING_UTF8)); -CPPUNIT_ASSERT(buf.makeStringAndClear().equalsAscii(pos)); +ASSERT_TRUE(buf.makeStringAndClear().equalsAscii(pos)); } static void doTestDurationF(char const*const pis) @@ -104,10 +91,10 @@ static void doTestDurationF(char const*c OSL_TRACE("%d %dY %dM %dD %dH %dM %dS %dH", od.Negative, od.Years, od.Months, od.Days, od.Hours, od.Minutes, od.Seconds, od.MilliSeconds); -CPPUNIT_ASSERT(!bSuccess); +ASSERT_TRUE(!bSuccess); } -void ConverterTest::testDuration() +TEST_F(ConverterTest, testDuration) { OSL_TRACE("\nSAX CONVERTER TEST BEGIN\n"); doTest( util::Duration(false, 1, 0, 0, 0, 0, 0, 0), "P1Y" ); @@ -158,13 +145,13 @@ static void doTest(util::DateTime const OSL_TRACE("Y:%d M:%d D:%d H:%d M:%d S:%d H:%d", odt.Year, odt.Month, odt.Day, odt.Hours, odt.Minutes, odt.Seconds, odt.HundredthSeconds); -CPPUNIT_ASSERT(bSuccess); -CPPUNIT_ASSERT(eqDateTime(rdt, odt)); +ASSERT_TRUE(bSuccess); +ASSERT_TRUE(eqDateTime(rdt, odt)); ::rtl::OUStringBuffer buf; Converter::convertDateTime(buf, odt, true); OSL_TRACE(
svn commit: r1701087 - in /openoffice/trunk/main/sax: prj/build.lst qa/cppunit/ qa/gtest/ qa/gtest/makefile.mk qa/gtest/version.map
Author: damjan Date: Thu Sep 3 17:44:40 2015 New Revision: 1701087 URL: http://svn.apache.org/r1701087 Log: Complete cppunit -> gtest migration in main/sax. Added: openoffice/trunk/main/sax/qa/gtest/ - copied from r1701084, openoffice/trunk/main/sax/qa/cppunit/ Removed: openoffice/trunk/main/sax/qa/cppunit/ openoffice/trunk/main/sax/qa/gtest/version.map Modified: openoffice/trunk/main/sax/prj/build.lst openoffice/trunk/main/sax/qa/gtest/makefile.mk Modified: openoffice/trunk/main/sax/prj/build.lst URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sax/prj/build.lst?rev=1701087=1701086=1701087=diff == --- openoffice/trunk/main/sax/prj/build.lst (original) +++ openoffice/trunk/main/sax/prj/build.lst Thu Sep 3 17:44:40 2015 @@ -3,4 +3,4 @@ ax sax usr1- all ax_mkout NULL ax sax\source\expatwrapnmake - all ax_expatwrap NULL ax sax\source\toolsnmake - all ax_tools NULL ax sax\source\fastparser nmake - all ax_fastparser ax_expatwrap ax_tools NULL -ax sax\qa\cppunit nmake - all ax_qa_cppunit ax_tools NULL +ax sax\qa\gtest nmake - all ax_qa_gtest ax_tools NULL Modified: openoffice/trunk/main/sax/qa/gtest/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sax/qa/gtest/makefile.mk?rev=1701087=1701084=1701087=diff == --- openoffice/trunk/main/sax/qa/gtest/makefile.mk (original) +++ openoffice/trunk/main/sax/qa/gtest/makefile.mk Thu Sep 3 17:44:40 2015 @@ -23,7 +23,7 @@ PRJ=../.. PRJNAME=sax -TARGET=qa_cppunit +TARGET=qa_gtest ENABLE_EXCEPTIONS=TRUE
svn commit: r1701088 - in /openoffice/trunk/main/sfx2/qa/cppunit: makefile.mk test_metadatable.cxx
Author: damjan Date: Thu Sep 3 17:51:30 2015 New Revision: 1701088 URL: http://svn.apache.org/r1701088 Log: #i125003# migrate main/sfx2 from cppunit to Google Test. Modified: openoffice/trunk/main/sfx2/qa/cppunit/makefile.mk openoffice/trunk/main/sfx2/qa/cppunit/test_metadatable.cxx Modified: openoffice/trunk/main/sfx2/qa/cppunit/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/qa/cppunit/makefile.mk?rev=1701088=1701087=1701088=diff == --- openoffice/trunk/main/sfx2/qa/cppunit/makefile.mk (original) +++ openoffice/trunk/main/sfx2/qa/cppunit/makefile.mk Thu Sep 3 17:51:30 2015 @@ -35,24 +35,18 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -#building with stlport, but cppunit was not built with stlport -.IF "$(USE_SYSTEM_STL)"!="YES" -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGSCXX+=-DADAPT_EXT_STL -.ENDIF -.ENDIF +.IF "$(ENABLE_UNIT_TESTS)" != "YES" +all: + @echo unit tests are disabled. Nothing to do. -CFLAGSCXX += $(CPPUNIT_CFLAGS) -DLLPRE = # no leading "lib" on .so files +.ELSE -# --- Libs - - -SHL1OBJS= \ +APP1OBJS= \ $(SLO)/test_metadatable.obj \ -SHL1STDLIBS= \ -$(CPPUNITLIB) \ +APP1STDLIBS= \ +$(GTESTLIB) \ $(SALLIB) \ $(CPPULIB) \ $(CPPUHELPERLIB) \ @@ -60,23 +54,13 @@ SHL1STDLIBS= \ $(SFXLIB) \ -SHL1TARGET= test_metadatable -SHL1RPATH = NONE -SHL1IMPLIB= i$(SHL1TARGET) -# SHL1DEF= $(MISC)/$(SHL1TARGET).def -DEF1NAME=$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp -SHL1VERSIONMAP= version.map - -# --- All object files - - -SLOFILES= \ - $(SHL1OBJS) \ - - +APP1TARGET= test_metadatable +APP1RPATH = NONE +APP1TEST = enabled # --- Targets -- .INCLUDE : target.mk -.INCLUDE : _cppunit.mk + +.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES" .END Modified: openoffice/trunk/main/sfx2/qa/cppunit/test_metadatable.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/qa/cppunit/test_metadatable.cxx?rev=1701088=1701087=1701088=diff == --- openoffice/trunk/main/sfx2/qa/cppunit/test_metadatable.cxx (original) +++ openoffice/trunk/main/sfx2/qa/cppunit/test_metadatable.cxx Thu Sep 3 17:51:30 2015 @@ -21,7 +21,7 @@ -#include +#include "gtest/gtest.h" #include #include @@ -38,26 +38,18 @@ using namespace ::com::sun::star; namespace { class MetadatableTest -: public ::CppUnit::TestFixture +: public ::testing::Test { public: -virtual void setUp(); -virtual void tearDown(); - -void test(); - -CPPUNIT_TEST_SUITE(MetadatableTest); -CPPUNIT_TEST(test); -CPPUNIT_TEST_SUITE_END(); - -private: +virtual void SetUp(); +virtual void TearDown(); }; -void MetadatableTest::setUp() +void MetadatableTest::SetUp() { } -void MetadatableTest::tearDown() +void MetadatableTest::TearDown() { } @@ -89,7 +81,7 @@ static bool operator==(beans::StringPair return p1.First == p2.First && p1.Second == p2.Second; } -void MetadatableTest::test() +TEST_F(MetadatableTest, test) { OSL_TRACE("SwMetadatable test(): start\n"); ::std::auto_ptr< ::sfx2::IXmlIdRegistry > const pReg( @@ -116,68 +108,54 @@ void MetadatableTest::test() beans::StringPair id3e(empty, sid3); beans::StringPair id4e(empty, sid4); m1.SetMetadataReference(id1); -CPPUNIT_ASSERT_MESSAGE("set failed", m1.GetMetadataReference() == id1); +ASSERT_TRUE(m1.GetMetadataReference() == id1) << "set failed"; try { m2.SetMetadataReference(id1); -CPPUNIT_ASSERT_MESSAGE("set duplicate succeeded", false); +ASSERT_TRUE(false) << "set duplicate succeeded"; } catch (lang::IllegalArgumentException) { } m1.SetMetadataReference(id1); -CPPUNIT_ASSERT_MESSAGE("set failed (existing)", -m1.GetMetadataReference() == id1); +ASSERT_TRUE(m1.GetMetadataReference() == id1) << "set failed (existing)"; m1.EnsureMetadataReference(); -CPPUNIT_ASSERT_MESSAGE("ensure failed (existing)", -m1.GetMetadataReference() == id1); +ASSERT_TRUE(m1.GetMetadataReference() == id1) << "ensure failed (existing)"; m2.EnsureMetadataReference(); beans::StringPair m2id(m2.GetMetadataReference()); -CPPUNIT_ASSERT_MESSAGE("ensure failed", m2id.Second.getLength()); +ASSERT_TRUE(m2id.Second.getLength()) << "ensure failed"; m2.EnsureMetadataReference(); -CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)", -m2.GetMetadataReference() == m2id); +ASSERT_TRUE(m2.GetMetadataReference() == m2id) << "ensure failed (idempotent)"; m1.m_bInUndo = true; -CPPUNIT_ASSERT_MESSAGE("move to undo failed", -!m1.GetMetadataReference().Second.getLength()); +
svn commit: r1701080 - in /openoffice/trunk/main/sal/qa/osl/profile: makefile.mk osl_old_testprofile.cxx
Author: damjan Date: Thu Sep 3 17:13:34 2015 New Revision: 1701080 URL: http://svn.apache.org/r1701080 Log: #i125003# migrate main/sal/qa/osl/profile from cppunit to Google Test. Modified: openoffice/trunk/main/sal/qa/osl/profile/makefile.mk openoffice/trunk/main/sal/qa/osl/profile/osl_old_testprofile.cxx Modified: openoffice/trunk/main/sal/qa/osl/profile/makefile.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/osl/profile/makefile.mk?rev=1701080=1701079=1701080=diff == --- openoffice/trunk/main/sal/qa/osl/profile/makefile.mk (original) +++ openoffice/trunk/main/sal/qa/osl/profile/makefile.mk Thu Sep 3 17:13:34 2015 @@ -36,33 +36,29 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(ENABLE_UNIT_TESTS)" != "YES" +all: + @echo unit tests are disabled. Nothing to do. + +.ELSE + CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) -CFLAGSCXX += $(CPPUNIT_CFLAGS) - # BEGIN -SHL1OBJS= \ +APP1OBJS= \ $(SLO)$/osl_old_testprofile.obj -SHL1TARGET= osl_old_testprofile -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) - -SHL1IMPLIB= i$(SHL1TARGET) -DEF1NAME=$(SHL1TARGET) -SHL1VERSIONMAP = $(PRJ)$/qa$/export.map -SHL1RPATH = NONE +APP1TARGET= osl_old_testprofile +APP1STDLIBS= $(SALLIB) $(GTESTLIB) +APP1RPATH = NONE +APP1TEST = enabled # END -- - -#--- All object files --- -# do this here, so we get right dependencies -SLOFILES=\ - $(SHL1OBJS) - # --- Targets -- .INCLUDE : target.mk -.INCLUDE : _cppunit.mk + +.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES" .END Modified: openoffice/trunk/main/sal/qa/osl/profile/osl_old_testprofile.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/osl/profile/osl_old_testprofile.cxx?rev=1701080=1701079=1701080=diff == --- openoffice/trunk/main/sal/qa/osl/profile/osl_old_testprofile.cxx (original) +++ openoffice/trunk/main/sal/qa/osl/profile/osl_old_testprofile.cxx Thu Sep 3 17:13:34 2015 @@ -33,26 +33,18 @@ #include #include -#include "cppunit/TestAssert.h" -#include "cppunit/TestFixture.h" -#include "cppunit/extensions/HelperMacros.h" -#include "cppunit/plugin/TestPlugIn.h" +#include "gtest/gtest.h" //== // - namespace osl_Profile { -class oldtests : public CppUnit::TestFixture +class oldtests : public ::testing::Test { public: -void test_profile(); - -CPPUNIT_TEST_SUITE( oldtests ); -CPPUNIT_TEST( test_profile ); -CPPUNIT_TEST_SUITE_END( ); }; -void oldtests::test_profile(void) +TEST_F(oldtests, test_profile) { oslProfile hProfile; rtl_uString* ustrProfileName=0; @@ -88,8 +80,8 @@ void oldtests::test_profile(void) } // namespace osl_Profile -// - -CPPUNIT_TEST_SUITE_REGISTRATION( osl_Profile::oldtests ); - -// - -CPPUNIT_PLUGIN_IMPLEMENT(); +int main(int argc, char **argv) +{ +::testing::InitGoogleTest(, argv); +return RUN_ALL_TESTS(); +}
buildbot success in ASF Buildbot on openoffice-linux64-rat-aoo410
The Buildbot has detected a passing build on builder openoffice-linux64-rat-aoo410 while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/openoffice-linux64-rat-aoo410/builds/54 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: tethys_ubuntu Build Reason: The Nightly scheduler named 'openoffice-linux64-rat-aoo410' triggered this build Build Source Stamp: [branch openoffice/branches/AOO410] HEAD Blamelist: Build succeeded! Sincerely, -The Buildbot
buildbot success in ASF Buildbot on openoffice-linux64-nightly
The Buildbot has detected a passing build on builder openoffice-linux64-nightly while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/openoffice-linux64-nightly/builds/68 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: tethys_ubuntu Build Reason: The Nightly scheduler named 'openoffice-linux64-nightly' triggered this build Build Source Stamp: [branch openoffice/trunk] HEAD Blamelist: Build succeeded! Sincerely, -The Buildbot
buildbot success in ASF Buildbot on openoffice-linux64-rat
The Buildbot has detected a passing build on builder openoffice-linux64-rat while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/openoffice-linux64-rat/builds/58 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: tethys_ubuntu Build Reason: The Nightly scheduler named 'openoffice-linux64-rat' triggered this build Build Source Stamp: [branch openoffice/trunk] HEAD Blamelist: Build succeeded! Sincerely, -The Buildbot
buildbot failure in ASF Buildbot on openoffice-fbsd-nightly
The Buildbot has detected a failed build on builder openoffice-fbsd-nightly while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/openoffice-fbsd-nightly/builds/58 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-fbsd2_64bit Build Reason: The Nightly scheduler named 'openoffice-fbsd-nightly' triggered this build Build Source Stamp: [branch openoffice/trunk] HEAD Blamelist: BUILD FAILED: failed build --all Sincerely, -The Buildbot
buildbot failure in ASF Buildbot on aoo-win7
The Buildbot has detected a failed build on builder aoo-win7 while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/aoo-win7/builds/72 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-win7 Build Reason: The Nightly scheduler named 'aoo-win7-nightly' triggered this build Build Source Stamp: [branch openoffice/trunk] HEAD Blamelist: BUILD FAILED: failed svn info configure bootstrap build.pl --all copy log index Sincerely, -The Buildbot
buildbot success in ASF Buildbot on openoffice-linux32-nightly
The Buildbot has detected a passing build on builder openoffice-linux32-nightly while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/openoffice-linux32-nightly/builds/74 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm2_ubuntu_32bit Build Reason: The Nightly scheduler named 'openoffice-linux32-nightly' triggered this build Build Source Stamp: [branch openoffice/trunk] HEAD Blamelist: Build succeeded! Sincerely, -The Buildbot