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

Update tests: port all to Catch2 2.8.0, removing old gtest #602

Merged
merged 21 commits into from
Jun 6, 2019

Conversation

rpavlik
Copy link
Member

@rpavlik rpavlik commented May 31, 2019

I was able to relatively quickly update most tests to Catch2, leaving behind the old version of catch entirely. I have also now done the last remaining gtest test (QuatExpMap) which became simpler when moved to Catch2, meaning that google test is no longer needed either and has been removed.

Builds on Debian Buster, tests pass except for test_fwd_headers which I'm pretty sure I didn't touch.

Apparently function differs between my cmake version and travis-ci's
@rpavlik rpavlik changed the title Update tests: port nearly all to Catch2 2.8.0 WIP Update tests: port nearly all to Catch2 2.8.0 May 31, 2019
@rpavlik rpavlik changed the title WIP Update tests: port nearly all to Catch2 2.8.0 Update tests: port all to Catch2 2.8.0, removing old gtest May 31, 2019
@rpavlik
Copy link
Member Author

rpavlik commented May 31, 2019

OK, I have now ported all the tests, so they should all build on MSVC2019 now too :)

Copy link
Contributor

@russell-taylor russell-taylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiles out of the box on Visual Studio 2019, even when OpenCV is not installed. Did not try installing Catch-22 to see if it also compiles in that case.

@russell-taylor
Copy link
Contributor

When I run the tests, all but #6 QuatExpMap succeed. It fails. Here is its output:

$ ./QuatExpMap.exe

QuatExpMap.exe is a Catch v2.8.0 host application.
Run with -? for options

-----------------------------------------------------------------------------------------------------------------------
UnitQuatInput
  Basic quats
  Basic run ln
  Round trip
-----------------------------------------------------------------------------------------------------------------------
F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(173)
.......................................................................................................................

F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(177): FAILED:
  REQUIRE( q == exp_ln_q )
with expansion:
  [(0.70710678118654757                   0                   0), 0.70710678118654757]
  ==
  [(0.70710678118654757                   0                   0), 0.70710678118654746]
with messages:
  qCreator := Angle 1.5708, Axis 1 0 0
  q := [(0.70710678118654757                   0                   0), 0.70710678118654757]
  isIdentityQuat := false

-----------------------------------------------------------------------------------------------------------------------
UnitQuatInput
  Basic quats
  Basic run ln
  Round trip
-----------------------------------------------------------------------------------------------------------------------
F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(173)
.......................................................................................................................

F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(177): FAILED:
  REQUIRE( q == exp_ln_q )
with expansion:
  [(                  0 0.70710678118654757                   0), 0.70710678118654757]
  ==
  [(                  0 0.70710678118654757                   0), 0.70710678118654746]
with messages:
  qCreator := Angle 1.5708, Axis 0 1 0
  q := [(                  0 0.70710678118654757                   0), 0.70710678118654757]
  isIdentityQuat := false

-----------------------------------------------------------------------------------------------------------------------
UnitQuatInput
  Basic quats
  Basic run ln
  Round trip
-----------------------------------------------------------------------------------------------------------------------
F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(173)
.......................................................................................................................

F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(177): FAILED:
  REQUIRE( q == exp_ln_q )
with expansion:
  [(                  0                   0 0.70710678118654757), 0.70710678118654757]
  ==
  [(                  0                   0 0.70710678118654757), 0.70710678118654746]
with messages:
  qCreator := Angle 1.5708, Axis 0 0 1
  q := [(                  0                   0 0.70710678118654757), 0.70710678118654757]
  isIdentityQuat := false

-----------------------------------------------------------------------------------------------------------------------
UnitQuatInput
  Basic quats
  Basic run ln
  Round trip
-----------------------------------------------------------------------------------------------------------------------
F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(173)
.......................................................................................................................

F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(177): FAILED:
  REQUIRE( q == exp_ln_q )
with expansion:
  [(-0.70710678118654757                   -0                   -0), 0.70710678118654757]
  ==
  [(-0.70710678118654757                   -0                   -0), 0.70710678118654746]
with messages:
  qCreator := Angle -1.5708, Axis 1 0 0
  q := [(-0.70710678118654757                   -0                   -0), 0.70710678118654757]
  isIdentityQuat := false

-----------------------------------------------------------------------------------------------------------------------
UnitQuatInput
  Basic quats
  Basic run ln
  Round trip
-----------------------------------------------------------------------------------------------------------------------
F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(173)
.......................................................................................................................

F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(177): FAILED:
  REQUIRE( q == exp_ln_q )
with expansion:
  [(                  -0 -0.70710678118654757                   -0), 0.70710678118654757]
  ==
  [(                  -0 -0.70710678118654757                   -0), 0.70710678118654746]
with messages:
  qCreator := Angle -1.5708, Axis 0 1 0
  q := [(                  -0 -0.70710678118654757                   -0), 0.70710678118654757]
  isIdentityQuat := false

-----------------------------------------------------------------------------------------------------------------------
UnitQuatInput
  Basic quats
  Basic run ln
  Round trip
-----------------------------------------------------------------------------------------------------------------------
F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(173)
.......................................................................................................................

F:\tmp\src\OSVR-Core\tests\cplusplus\Util\QuatExpMap.cpp(177): FAILED:
  REQUIRE( q == exp_ln_q )
with expansion:
  [(                  -0                   -0 -0.70710678118654757), 0.70710678118654757]
  ==
  [(                  -0                   -0 -0.70710678118654757), 0.70710678118654746]
with messages:
  qCreator := Angle -1.5708, Axis 0 0 1
  q := [(                  -0                   -0 -0.70710678118654757), 0.70710678118654757]
  isIdentityQuat := false

=======================================================================================================================
test cases:   5 |   4 passed | 1 failed
assertions: 238 | 232 passed | 6 failed

@rpavlik
Copy link
Member Author

rpavlik commented Jun 3, 2019

That's interesting that the round-trips are close but not quite. I was getting exact here on Linux. However, I see I already made the other direction of round trip "approximate" (wrapping one endpoint in ApproxVec), so I'll try that with the quat one too. (ApproxQuat, in this case - these two were added by me but function equivalently to the Catch2 Approx() feature with doubles - basically a safe floating-point compare.)

@rpavlik rpavlik merged commit 495648e into master Jun 6, 2019
@rpavlik rpavlik deleted the update-tests branch June 6, 2019 20:48
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

Successfully merging this pull request may close these issues.

2 participants