erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
8.05k stars 1.51k forks source link

Register unit_tests with CTest #697

Closed ChrisThrasher closed 2 years ago

ChrisThrasher commented 2 years ago

@erincatto,

This lets us run ctest in the binary dir or build the test target to automatically run all tests. This means CI scripts don't need updating when tests are added and new developers have an easier time making sure they run all tests.

ChrisThrasher commented 2 years ago

A more involved change would entail replacing enable_testing() with include(CTest) which would automatically give us the BUILD_TESTING option that many CMake projects replacing the BOX2D_BUILD_UNIT_TESTS option.

ChrisThrasher commented 2 years ago

I'm making more build system improvements here that I'd love to submit later if this PR is welcome.