Commit Graph
14 Commits
Author SHA1 Message Date
Stephan Bergmann 2f2246d22e external/cppunit: Run tests in deterministic order
What prompted me to make this change is that when I tried an --enable-lto build,
CppunitTest_xmlsecurity_signing failed in a non-obvious way, and I noticed that
it ran the individual tests in a different order than a --disable-lto build.

With this change, CppunitTest_xmlsecurity_signing also started to fail in the
--disable-lto build, which has meanwhile been fixed with
800eebfa82 "Database document apparently needs to
be closed before it is disposed".  No other tests started to fail in my
Linux --disable-lto-build with this change, and my Linux --enable-lto build
(using recent Fedora 32 GCC 10.2 and the default linker) also succeeds `make
check` after 800eebfa82, both with and without
this cppunit change.
(<https://bugs.documentfoundation.org/show_bug.cgi?id=126442> "LTO build
segfaults in sw_apitests" and <https://src.fedoraproject.org/rpms/libreoffice/c/
5d644f1606b76ffa4a102433849a824d7293a404> "%check fails with lto enabled"
indicate that older branches also fail CppunitTest_sw_apitests with
--enable-lto, but I could not reproduce that on current master.)

What happens in cppunit is that every CPPUNIT_TEST_SUITE_REGISTRATION (or other
macro like CPPUNIT_TEST_FIXTURE internally calling
CPPUNIT_TEST_SUITE_REGISTRATION) creates a global static variable whose ctor
inserts the address of a sub-object of that global static variable into the
TestFactoryRegistry::m_factories set.  Even if the order of invocation of those
ctors from one .cxx is deterministic, the relative order or the addresses of
those sub-objects inserted into the TestFactoryRegistry::m_factories set need
not be (though they probably typically are).  Another source of nondeterminism
is that the order of ctors from different .cxx is not specified (which might
have caused the CppunitTest_xmlsecurity_signing failures, given that test
includes suites from two different .cxx).

So to make test execution more reproducible, make the order in which the tests
are run deterministic, sorting them by name.  (When
TestFactoryRegistry::addTestToSuite the adds the sorted tests to
TestSuite::addTest, they are inserted into a TestSuite::m_tests vector, from
which point on things appear to already happen in a deterministic order.)

Change-Id: I40741f397a96772974fd41bacdb3dd763c885417
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100384
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-08 14:18:54 +02:00
Markus Mohrhard ffe9ff2cf6 update cppunit to 1.15.1
Change-Id: Ic27a77addb409a8d63ea44136a8d2410ee40c4d2
Reviewed-on: https://gerrit.libreoffice.org/85539
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2019-12-24 20:45:53 +01:00
Stephan Bergmann 07d04fd3ae Better fix for missing [[noreturn]] of CPPUNIT_FAIL
This includes a revert of commit 9808486a89 "Avoid
-Werror,-Wimplicit-fallthrough with clang-cl", and also undoes older MSVC
workarounds (that would start to cause "warning C4702: unreachable code" now).

Change-Id: If72bf336e12e0a2db589857e8875003dae861977
Reviewed-on: https://gerrit.libreoffice.org/67248
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-01 19:03:36 +01:00
Tor Lillqvist 999a9c183c Do build cppunit for iOS, too
I am writing a separate unit test app that will include selected
existing unit tests that make sense and are important to run on iOS.

Change-Id: I4722f1ed872ba21e181eeba5ed3b58e82d8fed72
Reviewed-on: https://gerrit.libreoffice.org/61049
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2018-09-27 21:05:27 +02:00
Stephan Bergmann b7b014781f Mark external/cppunit/gcc9.patch.0 as addressed upstream
Change-Id: I9071acc34d07f3819fb40c93bbee6b5bcc79a14a
Reviewed-on: https://gerrit.libreoffice.org/58691
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-07 18:41:17 +02:00
Stephan Bergmann 46c9312c54 external/cppunit: silence -Werror=deprecated-copy (GCC trunk towards GCC 9)
Change-Id: I2daec11938361a6988741bd29e713a36a4c77414
Reviewed-on: https://gerrit.libreoffice.org/58042
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-26 12:31:44 +02:00
Markus Mohrhard 6f12914ddf update cppunit to 1.14.0
Change-Id: I95fa42f4ef0580734b605df859c1660b29adb8b2
Reviewed-on: https://gerrit.libreoffice.org/36499
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-04-14 01:10:25 +02:00
Stephan Bergmann b3a7e32e8d external/cppunit: Visible function type RTTI for Clang -fsanitize=function
Change-Id: Ie2a6e993b7982629aed650d6534a09a9eefe1c51
2015-01-26 15:17:29 +01:00
Caolán McNamara 745105a482 try and help scan-build out wrt cppunit asserts
Change-Id: Id86607802415ad069aa88be98012a5c99f594218
2014-07-06 15:38:01 +01:00
Michael Meeks 02638a0865 cppunit: always compile with debugging symbols on windows.
Also cleanup some makefile pieces and give better error warnings.

Change-Id: I9f20d60f26d5828f60664941946c266c7d166f32
2014-05-24 20:05:46 +01:00
Stephan Bergmann 77ad60af11 Adapt CppUnit to our CPPUNIT_PLUGIN_EXPORT
...which mentions extern "C", so CppUnit's TestPlugInSignature must reflect
that.  It is a bit odd how CPPUNIT_PLUGIN_EXPORT needs to be passed into
CppUnit, so probably best to keep this as a local patch for now.  (Clang's
-fsanitize=undefined complained about the mismatch.)

Change-Id: Ied179a1afe82ceb04de4739c14cf8fadff31b80f
2014-05-22 14:33:31 +02:00
Caolán McNamara d7e7a44ccd coverity#12093[81-94], etc. null pointer dereference
coverity seems to think that code execution can continue
after a coverity test fails, but it will effectively halt
and not trundle into the dereference of the tested-for-NULL
pointer, try a [+kill] on the fail method

Change-Id: I07c9a074b5681c367a31637c8af78d52a9c88d59
2014-05-10 13:02:57 +01:00
Tor Lillqvist 2b8b417401 We don't use cppunit when cross-compiling
Change-Id: I8ff723233546d9becd001ab54a7df5ad98223f90
2013-10-17 22:53:44 +03:00
Khaled Hosny 7223027a3a fdo#70393: move cppunit to a subdir of external
Change-Id: I96ab796757af0c6c6741059b35fcaeefc2bf4507
Reviewed-on: https://gerrit.libreoffice.org/6286
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2013-10-17 17:17:22 +00:00