Skip to content

Add __func__ to unit test metadata printed on failure.

Nick Thompson requested to merge NAThompson/vtk-m:add_func_2 into master

This is a much more minimal attempt to improve the printed messages of the unit tests on failure.

Also pipes to std::cerr rather than std::cout, and replaces the VTKM_MATH_ASSERT that was duplicated in various places.

Here's a representative error message:

39: Error at ../vtkm/testing/UnitTestMath.cxx:919:TestDifferenceOfProducts
39:     Float distance for difference of products is which exceeds 1.5; this is in violation of a theorem proved by Jeannerod in doi.org/10.1090/S0025-5718-2013-02679-8. Is your build compiled with FMAs enabled?

The __FILE__:__LINE__:__func__ sequence is clickable in zsh and takes me directly to the relevant line.

Fingers crossed that <sstream> works on the devices . . .

Edited by Nick Thompson

Merge request reports