Closed emmenlau closed 4 years ago
@emmenlau sorry I did not see these PRs!
Is enable_testing()
a cmake function?
Hi, yes enable_testing()
is a cmake function (see https://cmake.org/cmake/help/latest/command/enable_testing.html) that adds additional functionality helpful for tests. A better description of what it does is actually given here: https://stackoverflow.com/a/50469013/7200132
Admittedly, I did not describe this PR very well. It adds the cmake option to enable or disable testing. But additionally, it defines a target that can be invoked i.e. via make test
(or whatever build system you use, ninja test
etcetc...) to execute the tests.
Cool! can you write up brief instructions / example here on these PR comments, so I can update the wiki? Like "here's example of disabling testing, here's the new make test command, and running tests, etc"
Here is an idea for the documentation, is that good?
The default is to build tests. In order to disable building the tests, use the cmake option ENABLE_TESTS
, i.e. disable with cmake -DENABLE_TESTS=OFF
or set ENABLE_TESTS
to OFF
in the graphical cmake interface. When tests are enabled, they can be executed with the test
target. For example, when using the Makefile
cmake generator, tests can be executed with make test
.
This PR adds a separate option
ENABLE_TESTS
, default On, to enable or disable tests.