5

In ctest documentation, I see the following statement: enable_testing: Enable testing for current directory and below.

If the ENABLE_TESTING command has been run, this command adds a test target to the current directory. If ENABLE_TESTING has not been run, this command does nothing. The tests are run by the testing subsystem by executing Exename with the specified arguments. Exename can be either an executable built by this project or an arbitrary executable on the system (like tclsh). The test will be run with the current working directory set to the CMakeList.txt files corresponding directory in the binary tree.

So, I removed ENABLE_TESTING from the current directory and above, however the tests are still working. Is it by default enabled? how can I disable the tests?

I want to disable the testing so that I can run ctest without starting all the tests. I want to add them one by one. the problem is that tests seems to be always enabled.

user1061392
  • 304
  • 3
  • 14
  • `enable_testing()` is also invoked if you have `include(CTest)`. Could that be it? – Fraser Jul 16 '13 at 00:06
  • I do not have `include(CTest)`. In fact, I deleted the whole build tree and recompile the whole code. Then, the tests disappeared. But this is not a good way to do it. I need good way to do it – user1061392 Jul 16 '13 at 18:35
  • What was the CMake version you were using when you asked this question? Perhaps it was asked at a time when CMake would not automatically re-configure when it detected that the configuration files had changed, which would explain why you needed to manually re-configure (that's what happens when you delete the build tree where the CMakeCache.txt and other CMake internal files are stored) and re-build. – starball Jan 18 '23 at 09:36

0 Answers0