| # Find nosetests; see spirv_add_nosetests() for opting in to nosetests in a |
| find_program(NOSETESTS_EXE NAMES nosetests PATHS $ENV{PYTHON_PACKAGE_PATH}) |
| message(STATUS "SPIRV-Tools: nosetests was not found - python support code will not be tested") |
| message(STATUS "SPIRV-Tools: nosetests found - python support code will be tested") |
| # Run nosetests on file ${PREFIX}_nosetest.py. Nosetests will look for classes |
| # and functions whose names start with "nosetest". The test name will be |
| function(spirv_add_nosetests PREFIX) |
| if(NOT "${SPIRV_SKIP_TESTS}" AND NOSETESTS_EXE) |
| COMMAND ${NOSETESTS_EXE} -m "^[Nn]ose[Tt]est" -v |
| ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}_nosetest.py) |