Project

General

Profile

Task #935

Simplify build system for unit tests

Added by Teemu Murtola over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
testing
Target version:
Difficulty:
uncategorized
Close

Description

There are three "external" dependencies for most of unit tests in master: Google Test, Google Mock, and libxml2. When I initially started writing them, I tried to make the build system such that it would simply not build tests that depend on a component if one of them is not found. Mainly to avoid situations where people would complain that they can't build stuff because they lack one of the above.

But now, Google Test and Google Mock are bundled in the source tree (including them in our build system is the only officially supported way of using them, and this was the simplest approach). Is there any reason to keep complexity in the build system to allow building only, e.g., tests that don't depend on Google Mock?

Another source of complexity is libxml2. I think it has been on the wiki for several years now that libxml2 is planned to be a mandatory dependence, so could we also assume this in the tests?

Basically, removing options to disable only some tests based on what external components are found would simplify the logic in CMakeFiles.txt significantly (and also the contents of src/testutils/ to a lesser extent). And as it is now, the logic disables a lot of unnecessary tests, but I don't see sufficient advantage in trying to improve it further, so is it worth trying to maintain something that "kind of" works?

Associated revisions

Revision 1da6b49a (diff)
Added by Teemu Murtola over 7 years ago

Simplify build system for unit tests.

- Now that gtest and gmock are build from bundled sources, there should
be no reason to allow disabling just gmock from the tests (at least
not strong enough reason compared to the complexity it brings to
writing the tests and maintaining the build system).
- Make libxml2 mandatory for building any unit tests. Again,
simplifies the build system significantly. Even before this change,
very few of the unit tests were built without libxml2.

Closes #935.

Change-Id: I8ec5552661860ca43a00d70957fd82d69dcdf739

History

#1 Updated by Teemu Murtola over 7 years ago

  • Status changed from New to Feedback wanted
  • Assignee set to Teemu Murtola

Change to do the simplification submitted for review: https://gerrit.gromacs.org/#/c/923/

#2 Updated by Teemu Murtola over 7 years ago

  • Status changed from Feedback wanted to Closed

#3 Updated by Teemu Murtola almost 6 years ago

  • Project changed from Source code reorganization to GROMACS
  • Category set to testing

Also available in: Atom PDF