Add TEST_REQUIRES
keyword in ecbuild_add_test
#78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds a new keyword
TEST_REQUIRES
which can be used to indicate dependencies between tests. When you run a single test, all the dependencies of that test will also run. This is very useful for any test that requires some data from nexus. Another good example is the tests in MultIO that compare the results of another test against a reference file.This works by setting the FIXTURES_SETUP on the dependency, and FIXTURES_REQUIRED on the test that has the dependency.
If you do not use the new keyword anywhere, the fixtures will not be added anywhere in your project either (unless you add it explicitly yourself). And, since it is a new keyword, this should be fully backwards compatible with existing cmake files.
I added two tests, one that does a very simple chain of dependencies where every test depends on the test before it. The other test has one test which depends on two tests, the dependency graph has a diamond shape.