Skip to content

Commit

Permalink
python: support run specific test case
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Aug 7, 2023
1 parent 5f8b889 commit e3e313a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ if(NOT DISABLE_MODELBOX_TEST)
COMMENT "Run python Test..."
)

# run single test case
# usage:
# cmake -DPYTHON_TEST_CASE=test_log.py ..
# make unittest-python-case
if (PYTHON_TEST_CASE)
message(STATUS "run test case for python: ${PYTHON_TEST_CASE}")
add_custom_target(unittest-python-case
COMMAND PYTHONPATH=${MODELBOX_PYTHON_BINARY_DIR} ${PYTHON_EXECUTABLE} ${MODELBOX_PYTHON_BINARY_DIR}/test/${PYTHON_TEST_CASE};
DEPENDS modelbox-python
WORKING_DIRECTORY ${TEST_WORKING_DIR}
COMMENT "Run python Test..."
)
add_dependencies(unittest-python-case all-drivers)
endif()

add_dependencies(unittest-python all-drivers)

list(APPEND MODELBOX_UNIT_TEST_TARGETS modelbox-python)
Expand Down

0 comments on commit e3e313a

Please sign in to comment.