CMakeLists.txt 1.2 KB
Newer Older
1 2
file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
Z
zn 已提交
3 4
file(GLOB TEST_DIST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_collective_*.py")
string(REPLACE ".py" "" TEST_DIST_OPS "${TEST_DIST_OPS}")
5 6

if (WITH_MLU)
Z
zn 已提交
7 8 9 10
    foreach(TEST_OP ${TEST_DIST_OPS})
        LIST(REMOVE_ITEM TEST_OPS ${TEST_OP})
    endforeach(TEST_OP)

11 12 13
    foreach(TEST_OP ${TEST_OPS})
        py_test_modules(${TEST_OP} MODULES ${TEST_OP})
    endforeach(TEST_OP)
Z
zn 已提交
14 15 16 17 18 19 20 21 22 23 24

    if(WITH_CNCL)
	foreach(TEST_OP ${TEST_DIST_OPS})
            py_test_modules(${TEST_OP} MODULES ${TEST_OP})
        endforeach(TEST_OP)
        bash_test_modules(test_launch_async_mlu START_BASH test_launch_async_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
	bash_test_modules(test_launch_cloud_mlu START_BASH test_launch_cloud_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
	bash_test_modules(test_launch_nproc_mlu START_BASH test_launch_nproc_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
        set_tests_properties(test_collective_broadcast PROPERTIES TIMEOUT 120)
	set_tests_properties(test_collective_allreduce PROPERTIES TIMEOUT 120)
    endif(WITH_CNCL)
25
endif()