<https://cgit.freedesktop.org/libreoffice/cppunit/commit/?id=48145587c4c2dc4f1e07d83073e136336c81ce79> adds a macro in cppunit that allows not spelling out the declaration / definition / registration of a testcase in a testsuite, but you can just do all of this with a single line of code. If you used googletest in other projects, this is probably familiar to you. This is just a macro, so it's easy to "bundle" it in core.git (for both the system and bundled cppunit case), so we can unconditionally use it right now. An example conversion looks like this: https://cgit.freedesktop.org/libreoffice/core/commit/?id=caec23449a21c0eacbb593330a5b22f8c60d58e8 Hopefully it's obvious how this avoids repetition, also makes it impossible to get the wrapping ifdefs wrong around the declaration/definition/registration in case such a condition is necessary. Declaring what exact testcase you want to run is still possible by setting CPPUNIT_TEST_NAME to "testFoo" from CPPUNIT_TEST_FIXTURE(FooTest, testFoo). It would be good to use this markup in our cppunit tests, if you just grep for CPPUNIT_TEST_SUITE, you'll see the places that could be converted over to CPPUNIT_TEST_FIXTURE. One test suite conversion / commit, please.
Hello, I looked at this EasyHack and made a patch at https://gerrit.libreoffice.org/#/c/69914/ But the commit that adds the CPPUNIT_TEST_FIXTURE macro (https://cgit.freedesktop.org/libreoffice/cppunit/commit/?id=48145587c4c2dc4f1e07d83073e136336c81ce79) is not yet on a released version of CppUnit, so the Jenkins build fails :/ I'll try to contact the maintainer of CppUnit to see if he can release a cppunit-1.14.1 version
You need to include unotest/bootstrapfixturebase.hxx if it's not already included, that handles the missing macro for you if it's not provided by cppunit (which is indeed the case currently, unless you have system-cppunit installed from git).
See the comments at <https://gerrit.libreoffice.org/#/c/68970/> from Markus and Eike, the new style also has some issues, so doing this conversion large-scale (in code you don't touch / maintain anyway) is not as a great idea as it sounded. Closing as won't fix.