[CMake] Error in running tests

Petr Kmoch petr.kmoch at gmail.com
Fri Apr 12 07:12:57 EDT 2013


Hi Lloyd.

Do you actually have a target (executable) named "test_rev"? And have you
built it before running RUN_TESTS? RUN_TEST (or its Makefile equivalent
'make test') doesn't automatically build the test executables before
running them.

Petr


On Fri, Apr 12, 2013 at 1:08 PM, Lloyd <lloydkl.tech at gmail.com> wrote:

> Hi,
>
> I was successful in creating and compiling a simple project C++/Visual
> studio using cmake. I have also included one unit test project. All these
> projects builds successfully. The test project source and main project
> source resides in the root directory of the project. When I try to run
> "RUN_TESTS" it gives me an error
>
> Test project E:/CMakeDemo/BuildDir
> 1>      Start 1: Test
> 1>  Could not find executable test_rev
> 1>  Looked in the following places:
> 1>  Unable to find executable: test_rev
> 1>  test_rev
> 1>  test_rev.exe
> 1>  Debug/test_rev
> 1>  Debug/test_rev.exe
> 1>  Debug/test_rev
> 1>  Debug/test_rev.exe
> 1>  1/1 Test #1: Test .............................***Not Run   0.00 sec
>
> I have added the tests in my main cmake file as shown below
>
> #Root cmake file
> cmake_minimum_required (VERSION 2.6)
> PROJECT (Tutorial)
>
> ADD_SUBDIRECTORY(src/lib/reverse)
> ADD_SUBDIRECTORY(src)
> #SUBDIRS(src/lib/reverse src)
>
> ############################################################
> SET (DO_TEST false CACHE BOOL "Enable Testing?")
> if(DO_TEST)
> MESSAGE (STATUS "Testing is enabled")
> ENABLE_TESTING()
> ADD_SUBDIRECTORY(tests)
>
>
> ADD_TEST(Test test_rev)
>
>
> endif(DO_TEST)
> #############################################################
>
>
> What am i missing here?
>
> Thanks a lot,
>   Lloyd
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130412/7852d191/attachment.htm>


More information about the CMake mailing list