<div dir="ltr"><div><div>Hi Lloyd.<br><br></div>Do you actually have a target (executable) named &quot;test_rev&quot;? And have you built it before running RUN_TESTS? RUN_TEST (or its Makefile equivalent &#39;make test&#39;) doesn&#39;t automatically build the test executables before running them.<br>
<br></div>Petr<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 12, 2013 at 1:08 PM, Lloyd <span dir="ltr">&lt;<a href="mailto:lloydkl.tech@gmail.com" target="_blank">lloydkl.tech@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>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 &quot;RUN_TESTS&quot; it gives me an error <br>

<br>Test project E:/CMakeDemo/BuildDir<br>1&gt;      Start 1: Test<br>1&gt;  Could not find executable test_rev<br>1&gt;  Looked in the following places:<br>1&gt;  Unable to find executable: test_rev<br>1&gt;  test_rev<br>

1&gt;  test_rev.exe<br>1&gt;  Debug/test_rev<br>1&gt;  Debug/test_rev.exe<br>1&gt;  Debug/test_rev<br>1&gt;  Debug/test_rev.exe<br>1&gt;  1/1 Test #1: Test .............................***Not Run   0.00 sec<br><br></div>
I have added the tests in my main cmake file as shown below<br>
<br>#Root cmake file<br>cmake_minimum_required (VERSION 2.6)<br>PROJECT (Tutorial)<br><br>ADD_SUBDIRECTORY(src/lib/reverse)<br>ADD_SUBDIRECTORY(src)<br>#SUBDIRS(src/lib/reverse src)<br><br>############################################################<br>

SET (DO_TEST false CACHE BOOL &quot;Enable Testing?&quot;)<br>if(DO_TEST)<br>MESSAGE (STATUS &quot;Testing is enabled&quot;)<br>ENABLE_TESTING()<br>ADD_SUBDIRECTORY(tests)<br><br><br>ADD_TEST(Test test_rev)<br><br><br>endif(DO_TEST)<br>

#############################################################<br></div><br><br></div>What am i missing here?<br><br></div>Thanks a lot,<br></div>  Lloyd<br><div><div><div><div><div><br><br></div></div></div></div></div></div>

<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>