summaryrefslogtreecommitdiff
path: root/testtools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-09-14 15:52:04 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-09-14 15:52:04 +0200
commit16bbeb5713f4f9894e81ecf34a0e00f56a425f96 (patch)
tree4b200ccc2a5c47dcdfee73bdcb88b1d9f7eaf364 /testtools
parent0f6cb25be8ef72ec1e3cadded38f0698edf08cb4 (diff)
Change the shared bridgetest code from static to dynamic library
...so ASan builds do not complain about ODR violations due to multiple instances of vtable for testtools::bridgetest::CurrentContextChecker after a53808c0ed577468393aced90963af6496706959 "loplugin:dllprivate" removed the SAL_DLLPRIVATE from class CurrentContextChecker (which apparently /did/ have an impact with -fvisibility-ms-compat, as used by Linux Clang ASan/UBSan builds). Change-Id: Ifb1ba1819f7ea989300f4696d44f9599a1436563
Diffstat (limited to 'testtools')
-rw-r--r--testtools/Library_bridgetest-common.mk38
-rw-r--r--testtools/Library_bridgetest.mk5
-rw-r--r--testtools/Library_cppobj.mk5
-rw-r--r--testtools/Module_testtools.mk2
-rw-r--r--testtools/StaticLibrary_bridgetest.mk28
-rw-r--r--testtools/source/bridgetest/currentcontextchecker.hxx6
-rw-r--r--testtools/source/bridgetest/dllapi.hxx25
-rw-r--r--testtools/source/bridgetest/multi.hxx3
8 files changed, 73 insertions, 39 deletions
diff --git a/testtools/Library_bridgetest-common.mk b/testtools/Library_bridgetest-common.mk
new file mode 100644
index 000000000000..1ca38bca6b49
--- /dev/null
+++ b/testtools/Library_bridgetest-common.mk
@@ -0,0 +1,38 @@
+# -*- 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,testtools_bridgetest-common))
+
+$(eval $(call gb_Library_add_defs,testtools_bridgetest-common, \
+ -DLO_DLLIMPLEMENTATION_TESTTOOLS \
+))
+
+$(eval $(call gb_Library_use_external,testtools_bridgetest-common,boost_headers))
+
+$(eval $(call gb_Library_use_internal_api,testtools_bridgetest-common,\
+ bridgetest \
+))
+
+$(eval $(call gb_Library_use_libraries,testtools_bridgetest-common, \
+ cppu \
+ cppuhelper \
+ sal \
+))
+
+$(eval $(call gb_Library_use_api,testtools_bridgetest-common,\
+ udkapi \
+))
+
+$(eval $(call gb_Library_add_exception_objects,testtools_bridgetest-common,\
+ testtools/source/bridgetest/currentcontextchecker \
+ testtools/source/bridgetest/multi \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/testtools/Library_bridgetest.mk b/testtools/Library_bridgetest.mk
index 7953b66145bb..52f335761fdf 100644
--- a/testtools/Library_bridgetest.mk
+++ b/testtools/Library_bridgetest.mk
@@ -19,16 +19,13 @@ $(eval $(call gb_Library_use_api,testtools_bridgetest,\
udkapi \
))
-$(eval $(call gb_Library_use_static_libraries,testtools_bridgetest,\
- testtools_bridgetest_s \
-))
-
$(eval $(call gb_Library_use_external,testtools_bridgetest,boost_headers))
$(eval $(call gb_Library_use_libraries,testtools_bridgetest,\
cppu \
cppuhelper \
sal \
+ testtools_bridgetest-common \
))
$(eval $(call gb_Library_add_exception_objects,testtools_bridgetest,\
diff --git a/testtools/Library_cppobj.mk b/testtools/Library_cppobj.mk
index f2d50d79b795..086b1fa0b6f5 100644
--- a/testtools/Library_cppobj.mk
+++ b/testtools/Library_cppobj.mk
@@ -26,14 +26,11 @@ $(eval $(call gb_Library_use_api,testtools_cppobj,\
$(eval $(call gb_Library_use_external,testtools_cppobj,boost_headers))
-$(eval $(call gb_Library_use_static_libraries,testtools_cppobj,\
- testtools_bridgetest_s \
-))
-
$(eval $(call gb_Library_use_libraries,testtools_cppobj,\
cppu \
cppuhelper \
sal \
+ testtools_bridgetest-common \
))
$(eval $(call gb_Library_add_exception_objects,testtools_cppobj,\
diff --git a/testtools/Module_testtools.mk b/testtools/Module_testtools.mk
index 9ffb2520ff4f..a1b84e175b30 100644
--- a/testtools/Module_testtools.mk
+++ b/testtools/Module_testtools.mk
@@ -15,9 +15,9 @@ $(eval $(call gb_Module_add_targets,testtools,\
CustomTarget_bridgetest \
InternalUnoApi_bridgetest \
InternalUnoApi_performance \
- StaticLibrary_bridgetest \
Library_cppobj \
Library_bridgetest \
+ Library_bridgetest-common \
Library_constructors \
Rdb_uno_services \
))
diff --git a/testtools/StaticLibrary_bridgetest.mk b/testtools/StaticLibrary_bridgetest.mk
deleted file mode 100644
index b1a076f8e537..000000000000
--- a/testtools/StaticLibrary_bridgetest.mk
+++ /dev/null
@@ -1,28 +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,testtools_bridgetest_s))
-
-$(eval $(call gb_StaticLibrary_use_external,testtools_bridgetest_s,boost_headers))
-
-$(eval $(call gb_StaticLibrary_use_internal_api,testtools_bridgetest_s,\
- bridgetest \
-))
-
-$(eval $(call gb_StaticLibrary_use_api,testtools_bridgetest_s,\
- udkapi \
-))
-
-$(eval $(call gb_StaticLibrary_add_exception_objects,testtools_bridgetest_s,\
- testtools/source/bridgetest/currentcontextchecker \
- testtools/source/bridgetest/multi \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/testtools/source/bridgetest/currentcontextchecker.hxx b/testtools/source/bridgetest/currentcontextchecker.hxx
index f431762e90ce..1877392129ac 100644
--- a/testtools/source/bridgetest/currentcontextchecker.hxx
+++ b/testtools/source/bridgetest/currentcontextchecker.hxx
@@ -28,9 +28,11 @@
#include "sal/types.h"
#include "test/testtools/bridgetest/XCurrentContextChecker.hpp"
+#include <dllapi.hxx>
+
namespace testtools { namespace bridgetest {
-class CurrentContextChecker :
+class LO_DLLPUBLIC_TESTTOOLS CurrentContextChecker :
public ::osl::DebugBase< CurrentContextChecker >,
public ::cppu::WeakImplHelper<
::test::testtools::bridgetest::XCurrentContextChecker >
@@ -49,7 +51,7 @@ private:
CurrentContextChecker(CurrentContextChecker &) = delete;
void operator =(CurrentContextChecker &) = delete;
- bool performCheck(
+ SAL_DLLPRIVATE bool performCheck(
css::uno::Reference< ::test::testtools::bridgetest::XCurrentContextChecker > const & other,
::sal_Int32 setSteps, ::sal_Int32 checkSteps);
};
diff --git a/testtools/source/bridgetest/dllapi.hxx b/testtools/source/bridgetest/dllapi.hxx
new file mode 100644
index 000000000000..8777a934a113
--- /dev/null
+++ b/testtools/source/bridgetest/dllapi.hxx
@@ -0,0 +1,25 @@
+/* -*- 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_TESTTOOLS_SOURCE_BRIDGETEST_DLLAPI_HXX
+#define INCLUDED_TESTTOOLS_SOURCE_BRIDGETEST_DLLAPI_HXX
+
+#include <sal/config.h>
+
+#include <sal/types.h>
+
+#if defined LO_DLLIMPLEMENTATION_TESTTOOLS
+#define LO_DLLPUBLIC_TESTTOOLS SAL_DLLPUBLIC_EXPORT
+#else
+#define LO_DLLPUBLIC_TESTTOOLS SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/testtools/source/bridgetest/multi.hxx b/testtools/source/bridgetest/multi.hxx
index 9909ce573247..6ed12840c7a0 100644
--- a/testtools/source/bridgetest/multi.hxx
+++ b/testtools/source/bridgetest/multi.hxx
@@ -29,6 +29,8 @@
#include "sal/types.h"
#include "test/testtools/bridgetest/XMulti.hpp"
+#include <dllapi.hxx>
+
namespace testtools { namespace bridgetest {
class Multi: public cppu::WeakImplHelper< test::testtools::bridgetest::XMulti >
@@ -109,6 +111,7 @@ private:
double m_attribute3;
};
+LO_DLLPUBLIC_TESTTOOLS
OUString testMulti( css::uno::Reference< test::testtools::bridgetest::XMulti > const & multi);
} }