[CMake] running python tests

David Cole david.cole at kitware.com
Wed Aug 25 10:48:15 EDT 2010


Show us your "add_test" call.

If it's a python script, execute the python interpreter and pass the script
as an arg:
add_test(${PYTHON_EXECUTABLE} "/full/path/to/script.py")


On Wed, Aug 25, 2010 at 10:39 AM, Mattia Tomasoni <
Mattia.Tomasoni.8371 at student.uu.se> wrote:

> Hello,
> I am using Cmake to run some tests after building my executable; my
> tests are .sh scripts. I would like them to be Python scripts instead.
> I wrote the following test script:
>
> print "success"
> exit(0)
>
> While the correspondent shell script will work, the Python equivalent
> exits complaining "Errors while running CTest".
>
> Could anyone point to the appropriate documentation or explain how to
> let CTest know that I want the Python interpreter to execute the script?
>
> Thank you,
> Mattia
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100825/afd67761/attachment.htm>


More information about the CMake mailing list