From 0638d6893ac646d24594a57ff943a903d9c0604e Mon Sep 17 00:00:00 2001 From: Superjom Date: Sun, 17 Dec 2017 10:25:43 +0800 Subject: [PATCH] add python test --- CMakeLists.txt | 1 + visualdl/python/CMakeLists.txt | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 visualdl/python/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d3f16750..4efc6748 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ include_directories(${PROJECT_SOURCE_DIR}/thirdparty/local/include) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualdl/storage) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualdl/logic) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualdl/python) add_executable(vl_test ${PROJECT_SOURCE_DIR}/visualdl/test.cc diff --git a/visualdl/python/CMakeLists.txt b/visualdl/python/CMakeLists.txt new file mode 100644 index 00000000..def51de9 --- /dev/null +++ b/visualdl/python/CMakeLists.txt @@ -0,0 +1,13 @@ +function(py_test TARGET_NAME) + set(options STATIC static SHARED shared) + set(oneValueArgs "") + set(multiValueArgs SRCS DEPS ARGS) + cmake_parse_arguments(py_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + add_test(NAME ${TARGET_NAME} + COMMAND env PYTHONPATH=${CMAKE_BINARY_DIR}/visualdl/logic + ${PYTHON_EXECUTABLE} -u ${py_test_SRCS} ${py_test_ARGS} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +endfunction() + +py_test(test_summary SRCS test_summary.py) -- GitLab