On Tue, Sep 21, 2010 at 4:19 AM, Jesper Eskilson <span dir="ltr">&lt;<a href="mailto:jesper.eskilson@iar.se">jesper.eskilson@iar.se</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I cannot get add_test to work as documented.<br>
<br>
  add_test(mytest MyExe)<br>
<br>
correctly runs MyExe. However, if I try to use any of the &quot;generator expressions&quot; (such as $&lt;CONFIGURATION&gt;), it fails:<br>
<br>
  add_test(mytest ${SOMEVARIABLE}/$&lt;CONFIGURATION&gt;/MyExe)<br>
<br>
fails to locate MyExe correctly, since it isn&#39;t expanding $&lt;CONFIGURATION&gt; correctly.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Looked in the following places:<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/Release/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/Release/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/Debug/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/Debug/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/MinSizeRel/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/MinSizeRel/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/RelWithDebInfo/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/RelWithDebInfo/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/Deployment/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/Deployment/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/Development/TestIDE<br>
/home/jesperes/dev/tooticki/core/ide/../stage/$&lt;CONFIGURATION&gt;/common/bin/Development/TestIDE<br>
</blockquote>
<br>
Also, the form<br>
<br>
  add_test(NAME mytest COMMAND MyCommand)<br>
<br>
doesn&#39;t work at all. No tests are generated, and &quot;make test&quot; complains that there aren&#39;t any tests.<br>
<br>
What am I doing wrong?<br>
<br>
I&#39;m using CMake 2.8.2.<br>
<br>
--<br>
/Jesper<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><div><br></div><br><div>$&lt;CONFIGURATION&gt; only works with the &quot;add_test(NAME mytest COMMAND MyCommand)&quot; form of the add_test command.</div><div><br></div><div>But, when you use that form, you have to run &quot;ctest -C Release&quot; or &quot;ctest -C Debug&quot; to choose a configuration when you run the tests. Otherwise, tests added with that form are skipped if ctest is called without a -C argument.</div>
<div><br></div><div>&quot;make test&quot; just runs &quot;ctest&quot; without -C, so you have to change the way you drive tests to use the add_test(NAME / COMMAND) signature. Usually, this is useful for folks focused on IDE builds like Visual Studio or Xcode. If you choose RUN_TESTS from inside the IDE, it already passes a -C arg to ctest, and so it should work from that context.</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br></div>