• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Find nosetests; see spirv_add_nosetests() for opting in to nosetests in a
2# specific directory.
3find_program(NOSETESTS_EXE NAMES nosetests PATHS $ENV{PYTHON_PACKAGE_PATH})
4if (NOT NOSETESTS_EXE)
5    message(STATUS "SPIRV-Tools: nosetests was not found - python support code will not be tested")
6else()
7    message(STATUS "SPIRV-Tools: nosetests found - python support code will be tested")
8endif()
9
10# Run nosetests on file ${PREFIX}_nosetest.py. Nosetests will look for classes
11# and functions whose names start with "nosetest". The test name will be
12# ${PREFIX}_nosetests.
13function(spirv_add_nosetests PREFIX)
14  if(NOT "${SPIRV_SKIP_TESTS}" AND NOSETESTS_EXE)
15    add_test(
16      NAME ${PREFIX}_nosetests
17      COMMAND ${NOSETESTS_EXE} -m "^[Nn]ose[Tt]est" -v
18        ${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}_nosetest.py)
19  endif()
20endfunction()
21