Commit Graph
105 Commits
Author SHA1 Message Date
Justin Luth 3489421136 cppunittester: [_RUN_____] indicates unit test start
-visual: so that the human eye can easily find it
-at start: to identify the last test if it ends abruptly
-no spaces: easy scripting | grep RUN | awk '{print $2}'

A visually unique, eye-catching start banner
will be helpful when browsing through logs,
or when adding asserts and running a make sw.check.

[I frequently look for existing unit tests that match
a certain condition in the 15 ooxmlexport tests.]

Previously, the tests ran in the order that they existed
in the file. So if one asserted/crashed in the middle of
the run, you could easily guess which test it was
by finding the name of the test that just finished OK.

However, since
   2f2246d22e
   Author: Stephan Bergmann on Sat Aug 8 12:00:23 2020
      external/cppunit: Run tests in deterministic order
the tests are sorted by name and run in
alphabetical order - which is not at all obvious or
intuitive. It certainly makes it harder to guess
what the next alphabetical name will be.

P.S. For consistency, I considered adding [____DONE_]
as well, but existing tooling might search for
"finished in:" and grab the first string (the test name)
so I don't want to break anything doing that.

Change-Id: I5521e681cd9f8304842290680f0389256fe3fe43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103268
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-25 11:17:01 +02:00
Stephan Bergmann 415a917450 Silence cid#1467434
Change-Id: Ibb996a3440a272405531c6d3cda0faa1d8c72ec2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103260
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-23 18:02:46 +02:00
Stephan Bergmann 43d08f3861 cppunittester: Do not unload test libraries
At least on Windows, e6dfaf9f44 "Turn
OUStringLiteral into a consteval'ed, static-refcound rtl_uString" caused
CppunitTest_sc_tablesheetsobj to fail at exit, when the

  static OUString aCacheName

in ScDocument::GetTable (sc/source/core/data/document.cxx) is destroyed but
references

  constexpr OUStringLiteral gaSrcSheetName(u"SheetToCopy")

from test/source/sheet/xspreadsheets2.cxx in Library_subsequenttest, referenced
(only) by the CppunitTest_sc_tablesheetsobj library, and both those libraries
had already been unloaded from memory.

Change-Id: Icea85019611fbaec3603f37b234e9e6fe3502961
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103103
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-21 15:26:05 +02:00
Mike Kaganski b3c8859cd2 Revert "Try to blind-solve cppunittester hangs on Windows"
This reverts commit 1126515226.

Reason for revert: it only took one run after merging the patch to see it
still hangs...

Change-Id: I9235004d0568462b112da7f23bc615f3647f4755
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94677
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-24 12:30:32 +02:00
Mike Kaganski 1126515226 Try to blind-solve cppunittester hangs on Windows
... calling OleInitialize early in sal_main to initialize COM and concurrency.

Seeing intermittent hangs in main thread in CAPNDataObject::GetData calling
m_rIDataObjectOrg->GetData, and the inner stack waiting objects in the code
doing apartment switching (I forgot to save a stack to paste unfortunately),
I suspect that being related to incorrect concurrency model. OleInitialize
docs [1] mention:

  Applications that use the following functionality must call OleInitialize
  before calling any other function in the COM library:

  * Clipboard
  * Drag and Drop
  * Object linking and embedding (OLE)
  * In-place activation

  ...

  Because OLE operations are not thread-safe, OleInitialize specifies the
  concurrency model as single-thread apartment.

CoInitializeEx sets COINIT_MULTITHREADED by default, so possibly that might
get called somewhere before clipboard/OLE code is called. I hope that this
change would fix those hangs.

[1] https://docs.microsoft.com/en-us/windows/win32/api/ole2/nf-ole2-oleinitialize

Change-Id: I7213c9d6cb4bd0691a3ce355995157797d7db93f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94675
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-05-24 10:28:59 +02:00
Noel Grandin b480819dc4 Revert "loplugin:constfields in reportdesign,sal,sax"
This reverts commit d4d37662b0.

Now that we know that making fields has negative side effects
like disabling assignment operator generation.

Change-Id: Idef4937b89a83d2efbfaf0ab87d059a0143c0164
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90364
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-12 09:22:20 +01:00
Noel Grandin 6f50961e69 remove more rtl::OUString and OString prefixes
which seem to have snuck back in since the great rounds of removals.

Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1
Reviewed-on: https://gerrit.libreoffice.org/62229
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24 14:43:34 +02:00
Noel Grandin d4d37662b0 loplugin:constfields in reportdesign,sal,sax
and improve the rewriter so I spend less time fixing formatting

Change-Id: Ic2a6e5e31a5a202d2d02a47d77c484a57a5ec514
Reviewed-on: https://gerrit.libreoffice.org/61676
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-12 12:46:45 +02:00
Arkadiy Illarionov 085269d25a Replace find_if with proper quantifier algorithms
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11
Reviewed-on: https://gerrit.libreoffice.org/59744
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29 11:40:29 +02:00
Gabor Kelemen c40109cc4e Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
in files formerly omitted for oversight or non-cxx extension

Change-Id: I327c573f44076c6ccfecf737eafccba2da72e1bd
Reviewed-on: https://gerrit.libreoffice.org/58600
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-06 16:04:35 +02:00
Stephan Bergmann ba8a70365e New loplugin:nestedunnamed
Change-Id: Ifb434589ef08428ce609bc7a40b015d4df13224c
Reviewed-on: https://gerrit.libreoffice.org/50048
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-21 08:09:46 +01:00
Stephan Bergmann 5a3bb76cd3 More loplugin:cstylecast: sal
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I7d89b011464ba5d2dd12e04d5fc9f65cb4daebde
2018-01-12 20:17:51 +01:00
Stephan Bergmann c30f3ea3dd loplugin:includeform: sal
Change-Id: I539ca8b9dee5edc5fc2282a2b9b0ffd78bad8b11
2017-10-23 22:45:58 +02:00
Mike Kaganski aaa26a58ba Some more WIN32_LEAN_AND_MEAN
Change-Id: Iadb0ebb66809c192fb817b8c7cf2f8cdb4d0b874
Reviewed-on: https://gerrit.libreoffice.org/42419
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-18 19:24:31 +02:00
Michael Stahl 86931aded4 sal: cppunittester: verify that CPPUNIT_TEST_NAME contains a test
Fail the test if CPPUNIT_TEST_NAME does not contain at least one
existing test, which is much better than silently reporting OK(0).

Change-Id: If2137764b24aa52dc35fe2368ee8fe38cb7dbece
2017-04-27 16:42:37 +02:00
Stephan Bergmann fd70d8ee89 Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)
Change-Id: I93eeb586310cb1896b067b7c665e1fdee92d47b4
2017-03-22 21:37:00 +01:00
Caolán McNamara dd8e0a4280 coverity#1371449 Uninitialized scalar field
Change-Id: I9e43b01f40cc325b83d23903fcec9010f848fb28
2016-08-19 13:00:44 +01:00
Michael Stahl f3cb21a3fb cppunittester: always print execution time of each test
Not much point in disabling this by default, nobody but the author
will find it.

Change-Id: I637b214644d2cc7bc70b8bca4f214955355ea951
2016-07-01 11:21:10 +02:00
Jochen Nitschke c210bf4510 tdf#94306 replace boost::noncopyable r.. to sdext
... in modules reportdesign to sdext
Replace with C++11 delete copy-constructur and
copy-assignment.
Remove boost/noncopyable.hpp includes.
Make some overloaded ctors explicit
(most in sd slidesorter).
Add deleted copy-assignment in sc/inc/chart2uno.hxx.

Change-Id: I21d4209f0ddb00063ca827474516a05ab4bb2f9a
Reviewed-on: https://gerrit.libreoffice.org/23970
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-11 07:15:35 +00:00
Noel Grandin 2087484c65 use consistent #define checks for the Windows platform
stage 2 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

In this stage we focus on replacing usage of the WIN macro

Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84
Reviewed-on: https://gerrit.libreoffice.org/22393
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17 11:33:57 +00:00
Noel Grandin ce43d0ae92 use consistent #define checks for the Windows platform
stage 1 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

Change-Id: Iece73abdee530937e0737190b1aa97a46cd3075f
Reviewed-on: https://gerrit.libreoffice.org/22390
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-16 10:37:55 +00:00
Caolán McNamara 16b93ae648 cppcheck: noExplicitConstructor
Change-Id: I74585aa5a50cd335f4fd0a3ba4fed230b98993c3
2016-02-08 12:17:34 +00:00
Markus Mohrhard 0c01878402 fix the new CPPUNIT_TEST_NAME code
Change-Id: I45260555778a733a8c8ba9e39e9ffcce0c9ab78d
Reviewed-on: https://gerrit.libreoffice.org/21818
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-01-26 21:21:44 +00:00
Markus Mohrhard 2a3a9dec50 support unnamed namespaces with CPPUNIT_TEST_NAME
Change-Id: I1ce50ce0ce8a4a461d1b2a34de132cbf57dd7d25
Reviewed-on: https://gerrit.libreoffice.org/21802
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-01-26 14:57:09 +00:00
Stephan Bergmann 26f05d59bc loplugin:nullptr (automatic rewrite)
Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8
2015-11-10 10:31:35 +01:00
Stephan Bergmann b36963c0a6 Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY code
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12 17:52:29 +02:00
Andrea Gelmini c15d93f252 Fix typos
Change-Id: Ia41f4f0ca30ae3346d0720271478ec5bcdab797b
Reviewed-on: https://gerrit.libreoffice.org/18967
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-09-30 07:07:18 +00:00
Michael Stahl 75a8f6173e sal: oops, forgot to commit that bit
Change-Id: Iee85958a6589624bc9a61242fca41214bdd1df85
2015-08-31 23:20:10 +02:00
Michael Stahl d0ebb6e438 sal: don't use --target as parameter to cppunittester
CppunitTest_libreofficekit_tiledrendering hangs because the soffice_main
exits due to the unrecognized command line arg --target.

Use a -env:VARIABLE argument instead, which is filtered out by
rtl_getAppCommandArg() so does not reach the soffice_main code.

(regression from 87514b0907)

Change-Id: I2c801305398dccfb447e4e5c44726f42bf2a72ef
2015-08-31 23:15:05 +02:00
Miklos Vajna e051cceec1 sal: loplugin:stringconstant
Change-Id: Ib4e7f4f71494abd654a70cf8ba8b0ca0afcd7df1
2015-08-31 10:39:52 +02:00
Markus Mohrhard 87514b0907 log resource usage of unit tests on UNX platforms
Change-Id: I3788eae60f73bc42488bf2e4961922962f7e505b
Reviewed-on: https://gerrit.libreoffice.org/18155
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-08-31 00:05:12 +00:00
Takeshi Abe 0980095619 Replace boost::scoped_array<T> with std::unique_ptr<T[]>
This may reduce some degree of dependency on boost.
Done by running a script like:

git grep -l '#include  *.boost/scoped_array.hpp.' \
 | xargs sed -i -e 's@#include  *.boost/scoped_array.hpp.@#include <memory>@'
git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \
 | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/'

... and then killing duplicate or unnecessary includes,
while changing manually
m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx,
extensions/source/ole/unoconversionutilities.hxx, and
extensions/source/ole/oleobjw.cxx.

Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd
Reviewed-on: https://gerrit.libreoffice.org/16289
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-17 15:50:45 +00:00
Caolán McNamara a5847cffce coverity#1297235 Uncaught exception
Change-Id: I6b135f6d47352c1fbb729788848913402b7bb742
2015-05-09 17:18:36 +01:00
Markus Mohrhard 9ce371fa16 provide a way to execute single test case from test suite
CPPUNIT_TEST_NAME is the environment variable that needs to be set and
contain the name of the tests. The test names need to be fully qualified
to be recognized.

Examples:

CPPUNIT_TEST_NAME="ScFiltersTest::testOutlineODS ScFiltersTest::testRangeNameXLS" make CppunitTest_sc_subsequent_filters_test

CPPUNIT_TEST_NAME="ScFiltersTest" make CppunitTest_sc_subsequent_filters_test

Change-Id: I78a8a076638e19c918ca1c411086bb353f5100a2
Reviewed-on: https://gerrit.libreoffice.org/15579
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-04-30 19:11:28 +00:00
Noel Grandin 1a08ce7078 loplugin:staticfunction
Change-Id: I10c30ef28e7321882a720d1e7869a75a89febfc5
2015-03-27 10:51:08 +02:00
Caolán McNamara 4d6a509efe convert all remaining BOOST_STATIC_ASSERT to static_assert
and we can include a few less headers

Change-Id: Id742849ff4c1c37a2b861aa3d6ab823f00ea87f8
2015-02-05 22:21:49 +00:00
Andrea Gelmini da40cac540 Fix common typos. No automatic tools. Handmade…
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959
Reviewed-on: https://gerrit.libreoffice.org/12164
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-12 11:04:11 +00:00
Michael Stahl c0b1d1bf57 cppunittester: make tracking down temp file leaks easier
Temp files created before first test method don't see LO_TESTNAME

Change-Id: Iff74abf574f5151980f463646f11c1b32ad0c241
2014-10-15 00:04:33 +02:00
Stephan Bergmann b2725b7d1b Keep TestFixture alive until outputter is done with it
Change-Id: Ifd921efa971f7a9a5c47f42c5d56a3deb1c3a0b3
2014-06-04 11:05:58 +02:00
Stephan Bergmann 9e13afeaf6 Cover ctors/dtors of our TestFixtures under the protectors, too
Change-Id: I4c3030e5a205bd102d0427e74d2fe3b828ff5ae6
2014-06-04 08:55:12 +02:00
Stephan Bergmann bf2e8fadd8 dlclose confuses LeakSanitizer
...so just do not bother unloading the protector libs again

Change-Id: I33caa7beaac3b5e6c4a4836061def24fc5372b70
2014-05-28 08:55:10 +02: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
Michael Meeks ef02ced3ec Win32 - warn of extraordinary behaviour with LoadLibrary and long PATHs
Change-Id: I0a8ee157aa548a5b04df67a2355e3f4fd15e84cd
2014-05-20 14:06:32 +01:00
Tor Lillqvist f9980adc43 Avoid the annoying line wrapping
Change-Id: I3ac2f0bf676491231bcd60eb91e8a36bc6c00620
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-05-06 16:55:26 +02:00
Markus Mohrhard 4439abe30f show the failure message again at the end of the test
Change-Id: Ia0bcbf0943aaa20dc5333dc4d18030ecf88e594e
2014-04-29 02:15:43 +02:00
Tor Lillqvist ca54d37245 Add a test listener that outputs failures to stderr as they happen
Makes them intermix properly with debugging output from the tested
functionality.

After the test has run, don't repeat the failure messages, just print a short
summary.

Change-Id: I6b491d3a34094df2da11df5e404adb63299de342
2014-04-24 10:43:56 +03:00
Tor Lillqvist 5723599896 Add informative comment about cross-compiling to iOS in particular
Change-Id: I7c38efdafea13bb5ae5e8a5e1cb07e77853b5c4b
2014-04-24 09:25:38 +03:00
Takeshi Abe 1ec8367608 Avoid possible memory leaks in case of exceptions
Change-Id: I047fd88a89900153089a55b6af123f11fb8bde55
2014-04-24 00:13:28 +09:00
Stephan Bergmann 82861c562f Properly cover in #ifdef TIMETESTS
Change-Id: Iff8f992e5260150b9ba108698b506f5a9ec7dea2
2014-04-03 15:29:22 +02:00
Stephan Bergmann dc9feb69f8 Move invariant writes outside loop
Change-Id: Ia254fe382a00be13a631fcc1b23f940352d8d3ba
2014-03-31 13:35:02 +02:00