Catch 2 is a header only library, and doing #define CATCH_CONFIG_MAIN
incurs quite a lot of work. It is recommended to not do this in the
files containing actual tests, to avoid that cost on incremental builds
when you're modifying your unit tests. (See
https://github.com/catchorg/Catch2/blob/master/docs/slow-compiles.md#top)
This commit follows the approach suggested by the Catch 2 documentation.
It removes #define CATCH_CONFIG_MAIN from tests.cpp, and adds a new
main.cpp which only does #define CATCH_CONFIG_MAIN.
This brings incremental compilation of tests down from 6.6 seconds to
1.8 seconds on my (decently powerful) machine.
Catch 2 is a header only library, and doing #define CATCH_CONFIG_MAIN incurs quite a lot of work. It is recommended to not do this in the files containing actual tests, to avoid that cost on incremental builds when you're modifying your unit tests. (See https://github.com/catchorg/Catch2/blob/master/docs/slow-compiles.md#top)
This commit follows the approach suggested by the Catch 2 documentation. It removes #define CATCH_CONFIG_MAIN from tests.cpp, and adds a new main.cpp which only does #define CATCH_CONFIG_MAIN.
This brings incremental compilation of tests down from 6.6 seconds to 1.8 seconds on my (decently powerful) machine.