10 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test
11 COMMAND ${CMAKE_COMMAND} -E copy_directory
12 ${CMAKE_CURRENT_SOURCE_DIR}/test ${CMAKE_CURRENT_BINARY_DIR}/test)
14 list(APPEND VISQ_TEST_DEPS ${CMAKE_CURRENT_BINARY_DIR}/test)
17 ### Import visqlib module
19 get_target_property(VISQ_BIN_PATH visq BINARY_DIR)
20 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/visqlib
21 COMMAND ${CMAKE_COMMAND} -E create_symlink
22 ${VISQ_BIN_PATH}/visqlib ${CMAKE_CURRENT_BINARY_DIR}/visqlib)
24 list(APPEND VISQ_TEST_DEPS ${CMAKE_CURRENT_BINARY_DIR}/visqlib)
27 ### Import pics module
29 get_target_property(PICS_BIN_PATH pics BINARY_DIR)
30 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/circle
31 COMMAND ${CMAKE_COMMAND} -E create_symlink
32 ${PICS_BIN_PATH}/circle ${CMAKE_CURRENT_BINARY_DIR}/circle)
34 list(APPEND VISQ_TEST_DEPS ${CMAKE_CURRENT_BINARY_DIR}/circle)
37 ### Generate Resources.py
39 set(RESOURCE_FILE "${CMAKE_CURRENT_BINARY_DIR}/test/Resources.py")
41 get_target_property(FP32_MODEL_DIR testDataGenerator BINARY_DIR)
44 OUTPUT ${RESOURCE_FILE}
45 COMMAND ${CMAKE_COMMAND} -E echo 'fp32_model_dir=\"${FP32_MODEL_DIR}\"' >> ${RESOURCE_FILE}
46 COMMENT "Generate file to specify resource location"
49 list(APPEND VISQ_TEST_DEPS ${RESOURCE_FILE})
51 add_custom_target(visq_unittest ALL DEPENDS ${VISQ_TEST_DEPS})
53 # Use Python in venv to run unittest with pydot module
56 COMMAND ${NNCC_OVERLAY_DIR}/venv_2_8_0/bin/python -m unittest
57 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
60 if(ONE_UBUNTU_CODENAME_JAMMY)
62 NAME visq_210_unittest
63 COMMAND ${NNCC_OVERLAY_DIR}/venv_2_10_1/bin/python -m unittest
64 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
66 endif(ONE_UBUNTU_CODENAME_JAMMY)