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

Revisit tests with zero assertions #864

Open
psalz opened this issue Feb 5, 2024 · 0 comments
Open

Revisit tests with zero assertions #864

psalz opened this issue Feb 5, 2024 · 0 comments

Comments

@psalz
Copy link
Member

psalz commented Feb 5, 2024

There are several test categories that can pass a run while reporting to have zero assertions. This is mostly due to one of two issues: Either the test category still uses the legacy framework for writing tests (which didn't have a concept of assertions, only fail/pass), or because the tests are written in the form of

if(!evaluateLotsOfThings()) FAIL("Test XY failed")

The atomic tests are an example of the former case, the address_space an example of the latter.

We should strive to have explicit assertions whenever possible, as this makes debugging failing tests much easier. A simple first step for the scenario above would be to change the condition to CHECK(evaluateLotsOfThings()). While this doesn't really help debugging, it at least indicates to the reader of a test report that something was checked for (otherwise the test may as well have returned on it's first line).

Without having checked each one in detail, this is a list of test categories that I suspect are in need of revisiting:

  • address_space
  • atomic
  • device_event
  • error
  • exception_handling
  • header
  • host_task
  • kernel_args
  • kernel_bundle (has_kernel_bundle_*, get_kernel_ids_* and get_kernel_bundle_* tests)
  • pointers
  • std_classes
  • vector_load_store
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

1 participant