Open hebasto opened 2 weeks ago
The
enable_testing()
command invocation is required foradd_test()
commands, which are used only for{noverify_}tests
,exhaustive_tests
and examples.
I don't think it's required. It's just that add_test()
has no effect without enable_testing()
.
enable_testing()
seems cheap. Couldn't we just run it always? Or do you think this has drawbacks?
The
enable_testing()
command invocation is required foradd_test()
commands, which are used only for{noverify_}tests
,exhaustive_tests
and examples.I don't think it's required. It's just that
add_test()
has no effect withoutenable_testing()
.
enable_testing()
seems cheap.
I agree.
Couldn't we just run it always?
Sure. The code has been adjusted.
Or do you think this has drawbacks?
I did some research and I haven't found any drawbacks. When enable_testing()
is invoked and no tests being added, the created CTestTestfile.cmake
files in the binary tree are noop/empty.
It is recommended:
to call
enable_testing()
somewhere in the top levelCMakeLists.txt
file. This would typically be done early, soon after the firstproject()
call.
CTest
module.The
CTest
module handlesCDash
integration, which we do not use. It is not required for testing functionality.enable_testing()
The
enable_testing()
command invocation is required foradd_test()
commands, which are used only for{noverify_}tests
,exhaustive_tests
and examples.