When to verify and when to compile?

Hello everyone!

As part of moving some documentation about testing infrastructure out of docstrings and to reStructuredText, I was hoping to add some information about the best practices for when to write a verify test and when to write a compile test.

I have several reasons in mind for choosing one over the other, but I would like to start the discussion with a blank slate and hear what the community has to say.

I hope that this venue is proper for asking for such help and I apologize for the spam if it isn’t.

Sincerely,
Will

I would say in general prefer compile tests over verify tests.
Only use verify tests if we want to make sure compilation fails for the proper reason. Some examples:

  • the expected static_assert is triggered
  • functions that are deprecated give a deprecated warning
  • functions that are removed no longer exist
  • [[nodiscard]] is present

I sincerely appreciate the response! Thank you!