<div class="gmail_quote">On Wed, Aug 25, 2010 at 11:11 AM, Eric Noulard <span dir="ltr"><<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>></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 <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>>:<br>
<div class="im">> Show us your "add_test" call.<br>
> If it's a python script, execute the python interpreter and pass the script<br>
> as an arg:<br>
> add_test(${PYTHON_EXECUTABLE} "/full/path/to/script.py")<br>
<br>
</div>I think you mean<br>
<br>
add_test(TestName ${PYTHON_EXECUTABLE} "/full/path/to/script.py")<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'm currently using on Linux<br>
(don'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 "/full/path/to/script.py")<br>
should work as well without trouble.<br>
<br>
David'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'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>