[CMake] Problem with testing with cmake

Philip Lowman philip at yhbt.com
Wed Feb 18 07:43:30 EST 2009


On Wed, Feb 18, 2009 at 5:31 AM, ankit jain <ankitguddu at gmail.com> wrote:

> Hi all,
>
> I have a directory structure with follwoign cmakelist as:
>
> myfold
> ....Cmakelist.txt
> ....subfolder
>
> subfolder
> ....Cmakelists.txt
> ....myfile.cpp
>
> Contents of Cmakelist of subfolder:
>
> add_executable(myfile myfile.cpp)
> target_link_libraries(myfile mylib)
> add_test(t1 myfile)
>
> t1 is the test case defined in myfile.cpp whose executable i have made.
>
> Contents of Camkelist of myfolder:
>
> Project(myfolder)
> ENABLE_TESTING()
> add_subdirectory(subfolder)
>

Looks fine to me.


>
> Now when i am running make test from the myfolder directory on the prompt
> it says test failed and saying error with ctest.
>

You can use "make test ARGS=-V" to enable verbose mode which may tell you a
bit more why the tests are failing.

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090218/b4b140ff/attachment.htm>


More information about the CMake mailing list