[CMake] running python tests

Michael Wild themiwi at gmail.com
Wed Aug 25 11:28:18 EDT 2010


Hi

find_package(PythonInterp REQUIRED)
add_test(NAME some_test
  COMMAND ${PYTHON_EXECUTABLE}
    ${CMAKE_CURRENT_BINARY_DIR}/run_test.py
    some_test)

or similar should do the trick.

Michael

On 25.08.2010, at 16:38, 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


More information about the CMake mailing list