Closed jbuckmccready closed 4 years ago
Settled on google test (found it the more ergonomic than Catch2 and easier to create parameterized tests). Added tests for C API cavc_pline
type, and the basic functions: cavc_get_area
, cavc_get_path_length
, cavc_get_extents
, cavc_get_closest_point
, and cavc_get_winding_number
. For the basic functions I implemented parameterized tests for simple axis aligned circles.
Added github actions that build and run tests on linux with gcc, windows with msvc, and macos with apple clang. Added additional compiler flags to set warnings set as build errors for CI.
Still to be done:
cavc_parallel_offset
cavc_combine_plines
cavc_pline_list
cavc_parallel_offset
that are known to have caused problems/found bugs in the pastAdded discrete tests to cavc_parallel_offset, see commit https://github.com/jbuckmccready/CavalierContours/commit/4bcfc46c488df958178218370778ef5e49c6e988.
Added tests for StaticSpatialIndex, see commit https://github.com/jbuckmccready/CavalierContours/commit/9d4023559581a601be6e61d60ce7fbca78bd6c06.
Added tests for cavc_combine_lines, see commit https://github.com/jbuckmccready/CavalierContours/commit/c69594d3bc455addf05f965b3acecd7df0d0e36e.
Closing this issue for now, infrastructure is now in place and many tests have been added. Will create specific issues for any new tests to be added.
Determine test framework to be used and create automated tests to cover as much of the library as possible. Google test is one possibility but it does not support property based testing out of the box, so I will look into some others.
Some of the functions that need tests are the following:
I would like to create discrete tests (known input and output), as well as property based tests (random but parameterized input with expected properties) to find numeric instabilities, or cases that might not be covered in the discrete tests. The generated data would include the following: