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

offer a mechanism to skip tests at runtime #326

Open
tych0 opened this issue Feb 8, 2024 · 2 comments
Open

offer a mechanism to skip tests at runtime #326

tych0 opened this issue Feb 8, 2024 · 2 comments

Comments

@tych0
Copy link

tych0 commented Feb 8, 2024

I see the documented https://cgreen-devs.github.io/cgreen/cgreen-guide-en.html#xensure xEnsure macro, but I have a test where I want to skip things at runtime (based on whether or not the kernel I'm using has new enough features). I don't see a way to do this, but it would be nice to have.

@thoni56
Copy link
Contributor

thoni56 commented Feb 8, 2024

A simple way to at least not fail tests that are dependent on run-time features is to use pass_test():

if (<run-time condition not met>)
    pass_test();
else {
    .... // the actual test
}

There is also fail_test(), not no skip_test() which probably would not be to hard to implement.

See https://cgreen-devs.github.io/cgreen/cgreen-guide-en.html#_writing_basic_tests.

@tych0
Copy link
Author

tych0 commented Feb 8, 2024

Yep, I've done an even simpler return;, but it would be nice to have it show up as skipped in the final stats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants