Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TEST_REQUIRES keyword in ecbuild_add_test #78

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

tweska
Copy link
Member

@tweska tweska commented Jan 22, 2025

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.

@marcosbento
Copy link
Collaborator

Looks like a good idea. I'll approve to let the tests run, and will eventually proceed with a code review.

Copy link
Member

@wdeconinck wdeconinck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks @tweska !

@marcosbento
Copy link
Collaborator

Looks good to me!
Thank you for the contribution, @tweska.
Merging now.

@marcosbento marcosbento merged commit 8ef56c6 into ecmwf:develop Jan 23, 2025
266 of 275 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants