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} 18 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 19 ) 20 21 SET_PROPERTY(TEST cram APPEND PROPERTY ENVIRONMENT "JSHN=$<TARGET_FILE:jshn>") 22 SET_PROPERTY(TEST cram APPEND PROPERTY ENVIRONMENT "TEST_BIN_DIR=$<TARGET_FILE_DIR:test-avl>")
This page was automatically generated by LXR 0.3.1. • OpenWrt