[Libreoffice-commits] core.git: 4 commits - sw/CppunitTest_sw_tox.mk sw/CppunitTest_sw_uwriter.mk sw/inc sw/Module_sw.mk sw/qa sw/source

Michael Stahl mstahl at redhat.com
Thu Aug 28 13:14:59 PDT 2014


 sw/CppunitTest_sw_tox.mk                         |   84 +++++++++++++++++++++++
 sw/CppunitTest_sw_uwriter.mk                     |    3 
 sw/Module_sw.mk                                  |    4 +
 sw/inc/IMark.hxx                                 |    2 
 sw/inc/docsh.hxx                                 |    1 
 sw/inc/globdoc.hxx                               |    1 
 sw/inc/swdll.hxx                                 |    4 -
 sw/inc/wdocsh.hxx                                |    1 
 sw/qa/core/uwriter.cxx                           |    1 
 sw/qa/cppunit/tox/test_ToxWhitespaceStripper.cxx |    3 
 sw/qa/extras/htmlexport/htmlexport.cxx           |    6 +
 sw/source/filter/basflt/fltini.cxx               |    1 
 sw/source/uibase/uno/unoatxt.cxx                 |    1 
 13 files changed, 102 insertions(+), 10 deletions(-)

New commits:
commit 1d6a8c4a950892bb72b7737209d3e3d8e467adf2
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Aug 28 21:59:31 2014 +0200

    sw: the tox test can now use the exported SwGlobals::ensure()
    
    Change-Id: Ibb4defec621fe479a877248a970eac15916ec6ec

diff --git a/sw/CppunitTest_sw_tox.mk b/sw/CppunitTest_sw_tox.mk
index 25ab0fc..761e007 100644
--- a/sw/CppunitTest_sw_tox.mk
+++ b/sw/CppunitTest_sw_tox.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_tox, \
 	svt \
 	svx \
 	svxcore \
+	sw \
 	test \
 	unotest \
 	vcl \
@@ -51,10 +52,6 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_tox, \
 	$(gb_UWINAPI) \
 ))
 
-$(eval $(call gb_CppunitTest_use_library_objects,sw_tox, \
-	sw \
-))
-
 $(eval $(call gb_CppunitTest_use_externals,sw_tox, \
 	boost_headers \
 	icuuc \
commit eb213e490d9a366477b921d1a408d85c4638499e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Aug 28 21:56:32 2014 +0200

    Revert "sw: _one_ unit test with use_library_objects sw ought to be enough"
    
    This reverts commit d2a4e7c7f70a0ff0769ed228320833fa6b29bff9.
    
    We now export SwGlobals::ensure for another test, so no need to use
    sw objects in this one...

diff --git a/sw/CppunitTest_sw_tox.mk b/sw/CppunitTest_sw_tox.mk
new file mode 100644
index 0000000..25ab0fc
--- /dev/null
+++ b/sw/CppunitTest_sw_tox.mk
@@ -0,0 +1,87 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# This file contains the unit test definition for class in the sources/core/tox subfolder
+# The macro which defines the main method is contained in test_ToxWhitespaceStripper.cxx
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_tox))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_tox, \
+	sw/qa/cppunit/tox/test_ToxWhitespaceStripper \
+	sw/qa/cppunit/tox/test_ToxLinkProcessor \
+	sw/qa/cppunit/tox/test_ToxTextGenerator \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_tox, \
+	$(call gb_Helper_optional,AVMEDIA,avmedia) \
+	basegfx \
+	comphelper \
+	cppu \
+	cppuhelper \
+	drawinglayer \
+	editeng \
+	i18nlangtag \
+	i18nutil \
+	lng \
+	sal \
+	salhelper \
+	sax \
+	sb \
+	sfx \
+	sot \
+	svl \
+	svt \
+	svx \
+	svxcore \
+	test \
+	unotest \
+	vcl \
+	tk \
+	tl \
+	ucbhelper \
+	utl \
+	xmlreader \
+	xo \
+	$(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_use_library_objects,sw_tox, \
+	sw \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_tox, \
+	boost_headers \
+	icuuc \
+	libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_tox,\
+	offapi \
+	udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_components,sw_tox, \
+	configmgr/source/configmgr \
+	framework/util/fwk \
+	i18npool/util/i18npool \
+	ucb/source/core/ucb1 \
+	ucb/source/ucp/file/ucpfile1 \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_tox))
+$(eval $(call gb_CppunitTest_use_ure,sw_tox))
+$(eval $(call gb_CppunitTest_use_vcl,sw_tox))
+
+$(eval $(call gb_CppunitTest_set_include,sw_tox,\
+    -I$(SRCDIR)/sw/inc \
+    -I$(SRCDIR)/sw/source/core/inc \
+    $$(INCLUDE) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk
index 287399a..495d088 100644
--- a/sw/CppunitTest_sw_uwriter.mk
+++ b/sw/CppunitTest_sw_uwriter.mk
@@ -14,9 +14,6 @@ $(eval $(call gb_CppunitTest_CppunitTest,sw_uwriter))
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_uwriter, \
     sw/qa/core/uwriter \
     sw/qa/core/Test-BigPtrArray \
-	sw/qa/cppunit/tox/test_ToxWhitespaceStripper \
-	sw/qa/cppunit/tox/test_ToxLinkProcessor \
-	sw/qa/cppunit/tox/test_ToxTextGenerator \
 ))
 
 $(eval $(call gb_CppunitTest_use_library_objects,sw_uwriter,sw))
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 33ea3f7..7e645c8 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -46,6 +46,10 @@ $(eval $(call gb_Module_add_targets,sw,\
 
 endif
 
+$(eval $(call gb_Module_add_check_targets,sw,\
+    CppunitTest_sw_tox \
+))
+
 $(eval $(call gb_Module_add_slowcheck_targets,sw,\
     CppunitTest_sw_uwriter \
     CppunitTest_sw_htmlexport \
diff --git a/sw/qa/cppunit/tox/test_ToxWhitespaceStripper.cxx b/sw/qa/cppunit/tox/test_ToxWhitespaceStripper.cxx
index 30da0bd..adaffd9 100644
--- a/sw/qa/cppunit/tox/test_ToxWhitespaceStripper.cxx
+++ b/sw/qa/cppunit/tox/test_ToxWhitespaceStripper.cxx
@@ -18,6 +18,7 @@
 #include <cppunit/TestAssert.h>
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
 
 using namespace sw;
 
@@ -144,4 +145,6 @@ ToxWhitespaceStripperTest::PositionAfterStringCanBeRequested()
 // Put the test suite in the registry
 CPPUNIT_TEST_SUITE_REGISTRATION(ToxWhitespaceStripperTest);
 
+CPPUNIT_PLUGIN_IMPLEMENT();
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 365b075e8469f1897fc8a90ede1dfd205feca82b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Aug 28 21:55:51 2014 +0200

    sw: why is swdll.hxx included everywhere?
    
    Change-Id: Ic401ca83666a887be9e5efe8369440e78fa4eeac

diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index 47bab9c..255a5bd 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -25,7 +25,7 @@
 #include <boost/operators.hpp>
 #include <boost/shared_ptr.hpp>
 #include <map>
-#include "swdll.hxx"
+#include <swdllapi.h>
 
 struct SwPosition;
 
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 4e03e15..c2ac6bb 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -26,7 +26,6 @@
 #include <sfx2/docfac.hxx>
 #include <sfx2/objsh.hxx>
 #include "swdllapi.h"
-#include <swdll.hxx>
 #include <shellid.hxx>
 
 #include <svl/lstner.hxx>
diff --git a/sw/inc/globdoc.hxx b/sw/inc/globdoc.hxx
index 76174e3..4aee52b 100644
--- a/sw/inc/globdoc.hxx
+++ b/sw/inc/globdoc.hxx
@@ -19,7 +19,6 @@
 #ifndef INCLUDED_SW_INC_GLOBDOC_HXX
 #define INCLUDED_SW_INC_GLOBDOC_HXX
 
-#include <swdll.hxx>
 #include "docsh.hxx"
 
 class SwGlobalDocShell : public SwDocShell
diff --git a/sw/inc/wdocsh.hxx b/sw/inc/wdocsh.hxx
index 015ec98..f142de2 100644
--- a/sw/inc/wdocsh.hxx
+++ b/sw/inc/wdocsh.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_INC_WDOCSH_HXX
 #include "swdllapi.h"
 #include "docsh.hxx"
-#include <swdll.hxx>
 
 class SW_DLLPUBLIC SwWebDocShell: public SwDocShell
 {
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 24bc114..ec62c05 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -46,6 +46,7 @@
 #include "swcrsr.hxx"
 #include "swscanner.hxx"
 #include "swmodule.hxx"
+#include <swdll.hxx>
 #include "swtypes.hxx"
 #include "fmtftn.hxx"
 #include "fmtrfmrk.hxx"
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index bd0f15b..7690bb8 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -16,6 +16,7 @@
 #include <rtl/byteseq.hxx>
 
 #include <swmodule.hxx>
+#include <swdll.hxx>
 #include <usrpref.hxx>
 
 #include <test/htmltesttools.hxx>
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index 0d86347..a1be84f 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -51,6 +51,7 @@
 #include <ndtxt.hxx>
 #include <swfltopt.hxx>
 #include <swerror.h>
+#include <swdll.hxx>
 #include <osl/module.hxx>
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 9d59a33..3aa4ba1 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -46,6 +46,7 @@
 #include <unoprnms.hxx>
 #include <docsh.hxx>
 #include <swmodule.hxx>
+#include <swdll.hxx>
 #include <svl/smplhint.hxx>
 #include <svl/macitem.hxx>
 #include <editeng/acorrcfg.hxx>
commit 125cbcbe6bbcf1cad7d885f0f6d3da5947d7fbbe
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Aug 28 21:44:36 2014 +0200

    sw: fix htmlexport test failure
    
    Somehow this test failed on Windows, because of restoring a "NONE" field
    unit to SW_MOD()... apparently the "charborder.odt" test is run first,
    and preTest() sees a null SW_MOD() then postTest restores a NONE metric.
    
    Hack around that by calling SwGlobals::ensure() to create SW_MOD().
    
    Change-Id: I6c0cda3aae397071bca16bf0e5d9f8105635550f

diff --git a/sw/inc/swdll.hxx b/sw/inc/swdll.hxx
index 707a256..9f5dddf 100644
--- a/sw/inc/swdll.hxx
+++ b/sw/inc/swdll.hxx
@@ -22,6 +22,8 @@
 #include <sfx2/sfxdefs.hxx>
 #include <sfx2/module.hxx>
 
+#include <swdllapi.h>
+
 namespace sw { class Filters; }
 
 /**
@@ -31,7 +33,7 @@ namespace sw { class Filters; }
 */
 namespace SwGlobals
 {
-    void ensure();
+    void SW_DLLPUBLIC ensure();
 
     sw::Filters & getFilters();
 }
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 9cfde5d..bd0f15b 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -51,9 +51,10 @@ private:
         else
             setFilterOptions("");
 
-        if (OString(filename) == "charborder.odt" && SW_MOD())
+        if (OString(filename) == "charborder.odt")
         {
             // FIXME if padding-top gets exported as inches, not cms, we get rounding errors.
+            SwGlobals::ensure(); // make sure that SW_MOD() is not 0
             SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(false));
             m_eUnit = pPref->GetMetric();
             pPref->SetMetric(FUNIT_CM);
@@ -62,7 +63,7 @@ private:
 
     void postTest(const char* filename) SAL_OVERRIDE
     {
-        if (OString(filename) == "charborder.odt" && SW_MOD())
+        if (OString(filename) == "charborder.odt")
         {
             SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(false));
             pPref->SetMetric(m_eUnit);


More information about the Libreoffice-commits mailing list