<div class="gmail_quote">On Wed, Aug 25, 2010 at 11:11 AM, Eric Noulard <span dir="ltr">&lt;<a href="mailto:eric.noulard@gmail.com">eric.noulard@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;">
2010/8/25 David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;:<br>
<div class="im">&gt; Show us your &quot;add_test&quot; call.<br>
&gt; If it&#39;s a python script, execute the python interpreter and pass the script<br>
&gt; as an arg:<br>
&gt; add_test(${PYTHON_EXECUTABLE} &quot;/full/path/to/script.py&quot;)<br>
<br>
</div>I think you mean<br>
<br>
add_test(TestName ${PYTHON_EXECUTABLE} &quot;/full/path/to/script.py&quot;)<br></blockquote><div><br></div><div>Yes, of course. I was too hasty on that reply... Thanks for the correction. :-) </div><div><br></div><div><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Another solution I&#39;m currently using on Linux<br>
(don&#39;t know how it work on Windows) is to add<br>
this as the very first line of your script:<br>
<br>
#!/usr/bin/env python<br>
<br>
+ making the script executable.<br>
<br>
Then<br>
add_test(TestName &quot;/full/path/to/script.py&quot;)<br>
should work as well without trouble.<br>
<br>
David&#39;s solution should work on Windows too as soon as you<br>
find_package(PythonInterp)<br>
<br>
see<br>
<a href="http://docs.python.org/tutorial/interpreter.html#executable-python-scripts" target="_blank">http://docs.python.org/tutorial/interpreter.html#executable-python-scripts</a><br>
<font color="#888888">--<br>
Erk<br>
Membre de l&#39;April - « promouvoir et défendre le logiciel libre » -<br>
<a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
</font></blockquote></div><br>