diff options
author | Carbenium <carbenium@outlook.com> | 2020-07-22 20:27:54 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-23 22:48:35 +0100 |
commit | f837f28171970b56781a57b5dc503e6067abecd2 (patch) | |
tree | 77612e6204d75908228bff2915e42771880855fd /cmake | |
parent | e8583d04f6a7744bd3576c3241873a8ad33f4f7a (diff) |
dep: Add catch2 unit test framework and wire it up
To enable the test suite, make sure to configure CMake with -DBUILD_TESTING=1 , since it is disabled by default. The catch2 dependency will be downloaded during configure time.
Also add a new target "tests-common", which includes unit tests for the "common" project. To finally run the tests use the "test" target.
CircleCI: Run unit tests
(cherry picked from commit 6a28ee7b2a4269aa7e43265d1cd0067537e3e883)
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/options.cmake | 1 | ||||
-rw-r--r-- | cmake/showoptions.cmake | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/cmake/options.cmake b/cmake/options.cmake index 2551ec72140..9cc6f9cbe87 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -54,3 +54,4 @@ option(COPY_CONF "Copy authserver and worldserver .conf.dist files to the set(WITH_SOURCE_TREE "hierarchical" CACHE STRING "Build the source tree for IDE's.") set_property(CACHE WITH_SOURCE_TREE PROPERTY STRINGS no flat hierarchical hierarchical-folders) option(WITHOUT_GIT "Disable the GIT testing routines" 0) +option(BUILD_TESTING "Build test suite" 0) diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index 66cec73089b..8cf5d85b913 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -39,6 +39,12 @@ else() message("* Build map/vmap tools : No") endif() +if(BUILD_TESTING) + message("* Build unit tests : Yes") +else() + message("* Build unit tests : No (default)") +endif() + if(USE_COREPCH) message("* Build core w/PCH : Yes (default)") else() |