1 FIND_PACKAGE(PythonInterp 3 REQUIRED) 2 FILE(GLOB test_cases "test_*.t") 3 4 SET(PYTHON_VENV_DIR "${CMAKE_CURRENT_BINARY_DIR}/.venv") 5 SET(PYTHON_VENV_PIP "${PYTHON_VENV_DIR}/bin/pip") 6 SET(PYTHON_VENV_CRAM "${PYTHON_VENV_DIR}/bin/cram") 7 8 ADD_CUSTOM_COMMAND( 9 OUTPUT ${PYTHON_VENV_CRAM} 10 COMMAND ${PYTHON_EXECUTABLE} -m venv ${PYTHON_VENV_DIR} 11 COMMAND ${PYTHON_VENV_PIP} install cram 12 ) 13 ADD_CUSTOM_TARGET(prepare-cram-venv ALL DEPENDS ${PYTHON_VENV_CRAM}) 14 15 ADD_TEST( 16 NAME cram 17 COMMAND ${PYTHON_VENV_CRAM} ${test_cases} ${test_cases_san} 18 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 19 ) 20 21 SET_PROPERTY(TEST cram APPEND PROPERTY ENVIRONMENT "BUILD_BIN_DIR=$<TARGET_FILE_DIR:ucode>") 22 23 IF(CMAKE_C_COMPILER_ID STREQUAL "Clang") 24 SET_PROPERTY(TEST cram APPEND PROPERTY ENVIRONMENT "UCODE_BIN=$<TARGET_FILE:ucode-san>") 25 ELSE() 26 SET_PROPERTY(TEST cram APPEND PROPERTY ENVIRONMENT "UCODE_BIN=valgrind --quiet --leak-check=full $<TARGET_FILE:ucode>") 27 ENDIF()
This page was automatically generated by LXR 0.3.1. • OpenWrt