Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


Hi,

<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).

Do anybody see this as a controversial move? If not, I think it would be
good to use this markup in two cases:

- new tests where you don't need to convert anything

- old tests where custom macros are used to do something similar, e.g.
  DECLARE_OOXMLEXPORT_TEST() (those custom macros are hard to understand
  if you don't work on that area, cf. Stephan's conference talk
  recently).

Perhaps an easy hack could be created for the second point, but I would
prefer some feedback before I go further with this.

Thanks,

Miklos

Attachment: signature.asc
Description: Digital signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.