Catch2 and Boost.Test provide similar features for writing unit tests. For a certain project I have to use Boost.Test instead of Catch2. The problem I have is that both use different format outputs.
For example, Catch2 will say that the was a fail in
test.cpp:9
(see example below). However Boost.Test will say
test.cpp(9): error in ...
.
This format doesn't allow my editor to recognize the output as a source location.
Is there way to make Boost.Test output the source location as file.ext:lineno
instead of file.ext(lineno)
?
This is a typical output for Catch2
----------------------------------------------
Testing Binary Search
----------------------------------------------
test.cpp:9
..............................................test.cpp:18: FAILED:
REQUIRE( binary_search(arr, 176) == 0 )
with expansion:
-1 == 0==============================================
test cases: 1 | 1 failed
assertions: 5 | 4 passed | 1 failed
This is a typical output for Boost.Test
Running 7 test cases...
./layout.hpp(764): error: in "layout_to_offset_1d_nontrivial": check L[3] == &B[3] - base(B) has failed [3 != 6]
Running 7 test cases...
./.././detail/layout.hpp(764): error: in "layout_to_offset_1d_nontrivial": check L[3] == &B[3] - base(B) has failed [3 != 6]
*** 1 failure is detected in the test module "C++ Unit Tests for Multi layout"