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

[FEA]: Add support for tests that compile, but fail at runtime #417

Closed
1 task done
ahendriksen opened this issue Sep 7, 2023 · 3 comments · Fixed by #418
Closed
1 task done

[FEA]: Add support for tests that compile, but fail at runtime #417

ahendriksen opened this issue Sep 7, 2023 · 3 comments · Fixed by #418
Labels
feature request New feature or request.

Comments

@ahendriksen
Copy link
Contributor

Is this a duplicate?

Area

libcu++

Is your feature request related to a problem? Please describe.

In review, an additional test was requested that should compile successfully, but fails at runtime.

  • fail tests checking that the APIs fail on non-supported state spaces

Originally posted by @gonzalobg in #358 (review)

Describe the solution you'd like

Add .runfail.cpp test type that is tested to compile correctly and to fail at runtime.

Describe alternatives you've considered

Naively, ff you want to test for success, you can also test for failure. There is one case where this is not true though and that is when we want the code to correctly assert when preconditions are not met.

Additional context

No response

@jrhemstad
Copy link
Collaborator

Could we use XFAIL: * in lit for this?

https://llvm.org/docs/TestingGuide.html#constraining-test-execution

@jrhemstad
Copy link
Collaborator

Ah, I suppose the difference is that you want to assert that it compiles successfully and fails during execution. @wmaxey or @miscco would need to confirm, but I think XFAIL will "succeed" even if it fails to compile.

@ahendriksen
Copy link
Contributor Author

ahendriksen commented Sep 7, 2023 via email

@github-project-automation github-project-automation bot moved this from Todo to Done in CCCL Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants