Home | History | Annotate | Download | only in cmake
      1 # Find nosetests; see spirv_add_nosetests() for opting in to nosetests in a
      2 # specific directory.
      3 find_program(NOSETESTS_EXE NAMES nosetests PATHS $ENV{PYTHON_PACKAGE_PATH})
      4 if (NOT NOSETESTS_EXE)
      5     message(STATUS "SPIRV-Tools: nosetests was not found - python support code will not be tested")
      6 else()
      7     message(STATUS "SPIRV-Tools: nosetests found - python support code will be tested")
      8 endif()
      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.
     13 function(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()
     20 endfunction()
     21