提交 0271eb00 编写于 作者: Q qili93

[NPU] fix cmake for ascend ci, test=develop

上级 0043fa8c
...@@ -1711,7 +1711,7 @@ function parallel_test_base_npu() { ...@@ -1711,7 +1711,7 @@ function parallel_test_base_npu() {
======================================== ========================================
EOF EOF
set +x set -x
test_cases=$(ctest -N -V) # get all test cases test_cases=$(ctest -N -V) # get all test cases
get_quickly_disable_ut||disable_ut_quickly='' # indicate whether the case was in quickly disable list get_quickly_disable_ut||disable_ut_quickly='' # indicate whether the case was in quickly disable list
while read -r line; do while read -r line; do
......
...@@ -279,22 +279,31 @@ function(py_test_modules TARGET_NAME) ...@@ -279,22 +279,31 @@ function(py_test_modules TARGET_NAME)
cmake_parse_arguments(py_test_modules "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) cmake_parse_arguments(py_test_modules "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(WITH_COVERAGE AND NOT (WITH_INCREMENTAL_COVERAGE AND "$ENV{PADDLE_GIT_DIFF_PY_FILE}" STREQUAL "")) if(WITH_COVERAGE AND NOT (WITH_INCREMENTAL_COVERAGE AND "$ENV{PADDLE_GIT_DIFF_PY_FILE}" STREQUAL ""))
add_test(NAME ${TARGET_NAME} if(WITH_ASCEND_CL)
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python ${py_test_modules_ENVS} add_test(NAME ${TARGET_NAME}
COVERAGE_FILE=${PADDLE_BINARY_DIR}/python-coverage.data COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python:$ENV{PYTHONPATH} ${py_test_modules_ENVS}
${PYTHON_EXECUTABLE} -m coverage run --branch -p ${PADDLE_SOURCE_DIR}/tools/test_runner.py ${py_test_modules_MODULES} COVERAGE_FILE=${PADDLE_BINARY_DIR}/python-coverage.data
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) ${PYTHON_EXECUTABLE} -m coverage run --branch -p ${PADDLE_SOURCE_DIR}/tools/test_runner.py ${py_test_modules_MODULES}
elseif(WITH_ASCEND_CL) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
# AscendCL need to include ascend toolkit python path, or ACL error will be thrown when running ctest else()
add_test(NAME ${TARGET_NAME} add_test(NAME ${TARGET_NAME}
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python:$ENV{PYTHONPATH} ${py_test_modules_ENVS} COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python ${py_test_modules_ENVS}
${PYTHON_EXECUTABLE} ${PADDLE_SOURCE_DIR}/tools/test_runner.py ${py_test_modules_MODULES} COVERAGE_FILE=${PADDLE_BINARY_DIR}/python-coverage.data
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) ${PYTHON_EXECUTABLE} -m coverage run --branch -p ${PADDLE_SOURCE_DIR}/tools/test_runner.py ${py_test_modules_MODULES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
else() else()
add_test(NAME ${TARGET_NAME} if(WITH_ASCEND_CL)
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python ${py_test_modules_ENVS} add_test(NAME ${TARGET_NAME}
${PYTHON_EXECUTABLE} ${PADDLE_SOURCE_DIR}/tools/test_runner.py ${py_test_modules_MODULES} COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python:$ENV{PYTHONPATH} ${py_test_modules_ENVS}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) ${PYTHON_EXECUTABLE} ${PADDLE_SOURCE_DIR}/tools/test_runner.py ${py_test_modules_MODULES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
else()
add_test(NAME ${TARGET_NAME}
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python ${py_test_modules_ENVS}
${PYTHON_EXECUTABLE} ${PADDLE_SOURCE_DIR}/tools/test_runner.py ${py_test_modules_MODULES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
endif() endif()
if (py_test_modules_SERIAL) if (py_test_modules_SERIAL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册