Commit Graph

12 Commits

Author SHA1 Message Date
Moritz Klammler
d7c04ed5ee Factor redundant test boilerplate out into unit_test.hpp helper 2022-09-29 19:02:52 +02:00
Moritz Klammler
fe471bcbe9 Autodetect the best option to use Boost.Test
The conditional inclusion of either the library or the header-only
version of the Boost.Test header wasn't tremendously useful in practice
because the tests/CMakeLists.txt file would unconditionally add compile
definitions to basically fore dynamic linking.

This patch adds feature detection to the tests/CMakeLists.txt file to
determine whether to use dynamic linking, static linking or the
header-only version (in that order of preference, for best performance).

The automatic detection could be overridden if needed by defining the
TOML11_WITH_BOOST_TEST_{HEADER,STATIC,DYNAMIC}
variables on the CMake command line.

While we are at it, instead of having a conditional
#define BOOST_TEST_NO_LIB
in each unit test file, handle this once in the CMakeLists.txt file.
2022-09-29 17:59:28 +02:00
ToruNiina
02fd8a577b feat: workaround __cplusplus problem on MSVC 2021-12-17 22:29:57 +09:00
ToruNiina
21ea4a348d test: explicitly specify template arguments
toml::value is an alias of default parameters, so we need to avoid
conflict of definitions between default and non-default parameters
2021-04-27 13:12:37 +09:00
ToruNiina
df097cb09a test: add test cases of get_or(value&&, U) 2019-09-28 12:13:59 +09:00
ToruNiina
a425e3b7c6 test: add test cases of toml::get_or(value&&, T&&) 2019-09-28 12:08:14 +09:00
ToruNiina
e4b4503b81 style: add comment to test::operator<< 2019-09-28 12:07:53 +09:00
ToruNiina
3fcb6bb20d test: fix test module name 2019-06-22 16:58:21 +09:00
ToruNiina
1e8af710a0 test: add test for get_or 2019-06-22 16:39:01 +09:00
ToruNiina
83b588a8c8 rename test code 2018-12-13 00:35:05 +09:00
ToruNiina
7be9548a6f fix test_module name 2017-12-11 14:30:25 +09:00
ToruNiina
3083f65493 add get_or 2017-12-11 12:04:57 +09:00