From 01c75db710126c88bcb6823386a8286a2a0de6fc Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 2 Dec 2016 15:07:40 +0100 Subject: convert test helper library to dynamic Change-Id: I5992cc7ac9ffb3974fa49bb7feec4b0212032386 --- Repository.mk | 1 + writerperfect/CppunitTest_writerperfect_calc.mk | 5 +-- writerperfect/CppunitTest_writerperfect_draw.mk | 5 +-- writerperfect/CppunitTest_writerperfect_impress.mk | 5 +-- writerperfect/CppunitTest_writerperfect_writer.mk | 5 +-- writerperfect/Library_wpftqahelper.mk | 42 ++++++++++++++++++++++ writerperfect/Module_writerperfect.mk | 2 +- .../StaticLibrary_writerperfect_filtertestbase.mk | 37 ------------------- writerperfect/qa/unit/WpftFilterFixture.hxx | 4 ++- writerperfect/qa/unit/WpftFilterTestBase.hxx | 4 ++- writerperfect/qa/unit/WpftLoader.hxx | 4 ++- writerperfect/qa/unit/wpftqahelperdllapi.h | 24 +++++++++++++ 12 files changed, 81 insertions(+), 57 deletions(-) create mode 100644 writerperfect/Library_wpftqahelper.mk delete mode 100644 writerperfect/StaticLibrary_writerperfect_filtertestbase.mk create mode 100644 writerperfect/qa/unit/wpftqahelperdllapi.h diff --git a/Repository.mk b/Repository.mk index b5326e98f384..5f42a924e660 100644 --- a/Repository.mk +++ b/Repository.mk @@ -499,6 +499,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE, \ vclbootstrapprotector \ scqahelper \ unowinreg \ + wpftqahelper \ $(if $(filter MSC,$(COM)),cli_cppuhelper) \ $(if $(filter $(OS),ANDROID),lo-bootstrap) \ $(if $(filter $(OS),MACOSX),OOoSpotlightImporter) \ diff --git a/writerperfect/CppunitTest_writerperfect_calc.mk b/writerperfect/CppunitTest_writerperfect_calc.mk index c7a8327c397a..9093396b9c2f 100644 --- a/writerperfect/CppunitTest_writerperfect_calc.mk +++ b/writerperfect/CppunitTest_writerperfect_calc.mk @@ -24,13 +24,10 @@ $(eval $(call gb_CppunitTest_use_libraries,writerperfect_calc,\ tl \ ucbhelper \ unotest \ + wpftqahelper \ $(gb_UWINAPI) \ )) -$(eval $(call gb_CppunitTest_use_static_libraries,writerperfect_calc,\ - writerperfect_filtertestbase \ -)) - $(eval $(call gb_CppunitTest_use_ure,writerperfect_calc)) $(eval $(call gb_CppunitTest_use_vcl,writerperfect_calc)) diff --git a/writerperfect/CppunitTest_writerperfect_draw.mk b/writerperfect/CppunitTest_writerperfect_draw.mk index bd7a582d0d15..c614805d7c12 100644 --- a/writerperfect/CppunitTest_writerperfect_draw.mk +++ b/writerperfect/CppunitTest_writerperfect_draw.mk @@ -24,13 +24,10 @@ $(eval $(call gb_CppunitTest_use_libraries,writerperfect_draw,\ tl \ ucbhelper \ unotest \ + wpftqahelper \ $(gb_UWINAPI) \ )) -$(eval $(call gb_CppunitTest_use_static_libraries,writerperfect_draw,\ - writerperfect_filtertestbase \ -)) - $(eval $(call gb_CppunitTest_use_ure,writerperfect_draw)) $(eval $(call gb_CppunitTest_use_vcl,writerperfect_draw)) diff --git a/writerperfect/CppunitTest_writerperfect_impress.mk b/writerperfect/CppunitTest_writerperfect_impress.mk index 352da2bee3f6..dea8b38f848c 100644 --- a/writerperfect/CppunitTest_writerperfect_impress.mk +++ b/writerperfect/CppunitTest_writerperfect_impress.mk @@ -24,13 +24,10 @@ $(eval $(call gb_CppunitTest_use_libraries,writerperfect_impress,\ tl \ ucbhelper \ unotest \ + wpftqahelper \ $(gb_UWINAPI) \ )) -$(eval $(call gb_CppunitTest_use_static_libraries,writerperfect_impress,\ - writerperfect_filtertestbase \ -)) - $(eval $(call gb_CppunitTest_use_ure,writerperfect_impress)) $(eval $(call gb_CppunitTest_use_vcl,writerperfect_impress)) diff --git a/writerperfect/CppunitTest_writerperfect_writer.mk b/writerperfect/CppunitTest_writerperfect_writer.mk index 3d20725fa344..6e7aa5ef9602 100644 --- a/writerperfect/CppunitTest_writerperfect_writer.mk +++ b/writerperfect/CppunitTest_writerperfect_writer.mk @@ -24,13 +24,10 @@ $(eval $(call gb_CppunitTest_use_libraries,writerperfect_writer,\ tl \ ucbhelper \ unotest \ + wpftqahelper \ $(gb_UWINAPI) \ )) -$(eval $(call gb_CppunitTest_use_static_libraries,writerperfect_writer,\ - writerperfect_filtertestbase \ -)) - $(eval $(call gb_CppunitTest_use_ure,writerperfect_writer)) $(eval $(call gb_CppunitTest_use_vcl,writerperfect_writer)) diff --git a/writerperfect/Library_wpftqahelper.mk b/writerperfect/Library_wpftqahelper.mk new file mode 100644 index 000000000000..aefd206c7632 --- /dev/null +++ b/writerperfect/Library_wpftqahelper.mk @@ -0,0 +1,42 @@ +# -*- 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/. +# + +$(eval $(call gb_Library_Library,wpftqahelper)) + +$(eval $(call gb_Library_set_include,wpftqahelper,\ + -I$(SRCDIR)/writerperfect/qa/unit \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_Library_add_defs,wpftqahelper,\ + -DWPFTQAHELPER_DLLIMPLEMENTATION \ +)) + +$(eval $(call gb_Library_use_externals,wpftqahelper,\ + boost_headers \ + cppunit \ +)) + +$(eval $(call gb_Library_use_sdk_api,wpftqahelper)) + +$(eval $(call gb_Library_use_libraries,wpftqahelper,\ + cppu \ + sal \ + test \ + ucbhelper \ + unotest \ +)) + +$(eval $(call gb_Library_add_exception_objects,wpftqahelper,\ + writerperfect/qa/unit/WpftFilterFixture \ + writerperfect/qa/unit/WpftFilterTestBase \ + writerperfect/qa/unit/WpftLoader \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/writerperfect/Module_writerperfect.mk b/writerperfect/Module_writerperfect.mk index c6a3b042ec4d..eda54bb63aa4 100644 --- a/writerperfect/Module_writerperfect.mk +++ b/writerperfect/Module_writerperfect.mk @@ -41,7 +41,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,writerperfect,\ CppunitTest_writerperfect_draw \ CppunitTest_writerperfect_impress \ CppunitTest_writerperfect_writer \ - StaticLibrary_writerperfect_filtertestbase \ + Library_wpftqahelper \ )) # vim: set noet sw=4 ts=4: diff --git a/writerperfect/StaticLibrary_writerperfect_filtertestbase.mk b/writerperfect/StaticLibrary_writerperfect_filtertestbase.mk deleted file mode 100644 index 8dec6fcfb734..000000000000 --- a/writerperfect/StaticLibrary_writerperfect_filtertestbase.mk +++ /dev/null @@ -1,37 +0,0 @@ -# -*- 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/. -# - -$(eval $(call gb_StaticLibrary_StaticLibrary,writerperfect_filtertestbase)) - -$(eval $(call gb_StaticLibrary_set_include,writerperfect_filtertestbase,\ - -I$(SRCDIR)/writerperfect/qa/unit \ - $$(INCLUDE) \ -)) - -$(eval $(call gb_StaticLibrary_use_externals,writerperfect_filtertestbase,\ - boost_headers \ - cppunit \ -)) - -$(eval $(call gb_StaticLibrary_use_sdk_api,writerperfect_filtertestbase)) - -$(eval $(call gb_StaticLibrary_use_libraries,writerperfect_filtertestbase,\ - cppu \ - sal \ - test \ - unotest \ -)) - -$(eval $(call gb_StaticLibrary_add_exception_objects,writerperfect_filtertestbase,\ - writerperfect/qa/unit/WpftFilterFixture \ - writerperfect/qa/unit/WpftFilterTestBase \ - writerperfect/qa/unit/WpftLoader \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/writerperfect/qa/unit/WpftFilterFixture.hxx b/writerperfect/qa/unit/WpftFilterFixture.hxx index 4e45a3845220..fe8acc2a0133 100644 --- a/writerperfect/qa/unit/WpftFilterFixture.hxx +++ b/writerperfect/qa/unit/WpftFilterFixture.hxx @@ -12,6 +12,8 @@ #include "config_writerperfect.h" +#include "wpftqahelperdllapi.h" + #include #include @@ -63,7 +65,7 @@ namespace writerperfect namespace test { -class WpftFilterFixture : public ::test::BootstrapFixture +class WPFTQAHELPER_DLLPUBLIC WpftFilterFixture : public ::test::BootstrapFixture { public: virtual void setUp() override; diff --git a/writerperfect/qa/unit/WpftFilterTestBase.hxx b/writerperfect/qa/unit/WpftFilterTestBase.hxx index 7042daaadf47..34aa728eaa61 100644 --- a/writerperfect/qa/unit/WpftFilterTestBase.hxx +++ b/writerperfect/qa/unit/WpftFilterTestBase.hxx @@ -10,6 +10,8 @@ #ifndef INCLUDED_WRITERPERFECT_QA_UNIT_WPFTFILTERTESTBASE_HXX #define INCLUDED_WRITERPERFECT_QA_UNIT_WPFTFILTERTESTBASE_HXX +#include "wpftqahelperdllapi.h" + #include #include @@ -41,7 +43,7 @@ namespace test typedef std::unordered_map WpftOptionalMap_t; -class WpftFilterTestBase +class WPFTQAHELPER_DLLPUBLIC WpftFilterTestBase : public ::test::FiltersTest , public WpftFilterFixture { diff --git a/writerperfect/qa/unit/WpftLoader.hxx b/writerperfect/qa/unit/WpftLoader.hxx index a854a531d5db..97f2987ba548 100644 --- a/writerperfect/qa/unit/WpftLoader.hxx +++ b/writerperfect/qa/unit/WpftLoader.hxx @@ -10,6 +10,8 @@ #ifndef INCLUDED_WRITERPERFECT_QA_UNIT_WPFTLOADER_HXX #define INCLUDED_WRITERPERFECT_QA_UNIT_WPFTLOADER_HXX +#include "wpftqahelperdllapi.h" + #include #include @@ -55,7 +57,7 @@ namespace writerperfect namespace test { -class WpftLoader +class WPFTQAHELPER_DLLPUBLIC WpftLoader { public: WpftLoader( diff --git a/writerperfect/qa/unit/wpftqahelperdllapi.h b/writerperfect/qa/unit/wpftqahelperdllapi.h new file mode 100644 index 000000000000..9f19a29729c2 --- /dev/null +++ b/writerperfect/qa/unit/wpftqahelperdllapi.h @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_WRITERPERFECT_QA_UNIT_WPFTQAHELPERDLLAPI_H +#define INCLUDED_WRITERPERFECT_QA_UNIT_WPFTQAHELPERDLLAPI_H + +#include + +#if defined(WPFTQAHELPER_DLLIMPLEMENTATION) +#define WPFTQAHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define WPFTQAHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif +#define WPFTQAHELPER_DLLPRIVATE SAL_DLLPRIVATE + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit