From cd29714af02293d8e7ee622c2d3b38faf91d2c14 Mon Sep 17 00:00:00 2001 From: Yancey1989 Date: Fri, 24 Nov 2017 19:11:41 +0800 Subject: [PATCH] fix py unit test executable --- cmake/generic.cmake | 2 +- cmake/util.cmake | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/cmake/generic.cmake b/cmake/generic.cmake index b9c1dde97bc..404717187d0 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -463,7 +463,7 @@ function(py_test TARGET_NAME) cmake_parse_arguments(py_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) add_test(NAME ${TARGET_NAME} COMMAND env PYTHONPATH=${PADDLE_PYTHON_BUILD_DIR}/lib-python - python2 ${py_test_SRCS} + ${PYTHON_EXECUTABLE} ${py_test_SRCS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endif() endfunction() diff --git a/cmake/util.cmake b/cmake/util.cmake index ad905ab55ba..0dc33ce3851 100644 --- a/cmake/util.cmake +++ b/cmake/util.cmake @@ -168,17 +168,3 @@ function(create_resources res_file output_file) COMMAND python ARGS ${PADDLE_SOURCE_DIR}/cmake/make_resource.py ${res_file} ${output_file} DEPENDS ${res_file} ${PADDLE_SOURCE_DIR}/cmake/make_resource.py) endfunction() - - -# Create a python unittest using run_python_tests.sh, -# which takes care of making correct running environment -function(add_python_test TEST_NAME) - foreach(arg ${ARGN}) - get_filename_component(py_fn ${arg} NAME_WE) - set(TRG_NAME ${TEST_NAME}_${py_fn}) - add_test(NAME ${TRG_NAME} - COMMAND env PYTHONPATH=${PADDLE_PYTHON_PACKAGE_DIR} - python2 ${arg} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - endforeach() -endfunction() -- GitLab