Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,38 @@ function(bash_test_modules TARGET_NAME)
endif()
endfunction()

function(set_pit_tests_properties)
file(STRINGS "${CMAKE_SOURCE_DIR}/test/white_list/pir_op_test_white_list"
PIR_OP_TESTS)
foreach(IR_OP_TEST ${PIR_OP_TESTS})
if(TEST ${IR_OP_TEST})
set_tests_properties(
${IR_OP_TEST} PROPERTIES ENVIRONMENT "FLAGS_PIR_OPTEST_WHITE_LIST=True")
endif()
endforeach()

file(STRINGS "${CMAKE_SOURCE_DIR}/test/white_list/pir_op_test_no_check_list"
PIR_OP_NO_CHECK_TESTS)
foreach(IR_OP_TEST ${PIR_OP_NO_CHECK_TESTS})
if(TEST ${IR_OP_TEST})
set_tests_properties(${IR_OP_TEST} PROPERTIES ENVIRONMENT
"FLAGS_PIR_NO_CHECK=True")
endif()
endforeach()

file(STRINGS
"${CMAKE_SOURCE_DIR}/test/white_list/pir_op_test_precision_white_list"
PIR_OP_RELAXED_TESTS)
foreach(IR_OP_TEST ${PIR_OP_RELAXED_TESTS})
if(TEST ${IR_OP_TEST})
set_tests_properties(
${IR_OP_TEST} PROPERTIES ENVIRONMENT
"FLAGS_PIR_OPTEST_RELAX_CHECK=True")
endif()
endforeach()

endfunction()

if(WITH_TESTING)
if(WITH_CINN)
add_subdirectory(cpp/cinn)
Expand Down Expand Up @@ -256,3 +288,5 @@ add_custom_target(build_tests)
if(${len} GREATER_EQUAL 1)
add_dependencies(build_tests ${test_names})
endif()

set_pit_tests_properties()
2 changes: 2 additions & 0 deletions test/distribution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP})
endforeach()

set_pit_tests_properties()
2 changes: 2 additions & 0 deletions test/fft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP})
endforeach()

set_pit_tests_properties()
37 changes: 2 additions & 35 deletions test/legacy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1398,41 +1398,6 @@ set_tests_properties(test_sync_batch_norm_op_static_build
PROPERTIES LABELS "RUN_TYPE=DIST")
set_tests_properties(test_sync_batch_norm_op_static_build PROPERTIES TIMEOUT
250)

file(STRINGS "${CMAKE_SOURCE_DIR}/test/white_list/pir_op_test_white_list"
PIR_OP_TESTS)
foreach(IR_OP_TEST ${PIR_OP_TESTS})
if(TEST ${IR_OP_TEST})
set_tests_properties(
${IR_OP_TEST} PROPERTIES ENVIRONMENT "FLAGS_PIR_OPTEST_WHITE_LIST=True")
else()
message(STATUS "PIR OpTest: not found ${IR_OP_TEST} in legacy_test")
endif()
endforeach()

file(STRINGS "${CMAKE_SOURCE_DIR}/test/white_list/pir_op_test_no_check_list"
PIR_OP_NO_CHECK_TESTS)
foreach(IR_OP_TEST ${PIR_OP_NO_CHECK_TESTS})
if(TEST ${IR_OP_TEST})
set_tests_properties(${IR_OP_TEST} PROPERTIES ENVIRONMENT
"FLAGS_PIR_NO_CHECK=True")
else()
message(STATUS "PIR OpTest: not found ${IR_OP_TEST} in legacy_test")
endif()
endforeach()

file(STRINGS
"${CMAKE_SOURCE_DIR}/test/white_list/pir_op_test_precision_white_list"
PIR_OP_RELAXED_TESTS)
foreach(IR_OP_TEST ${PIR_OP_RELAXED_TESTS})
if(TEST ${IR_OP_TEST})
set_tests_properties(
${IR_OP_TEST} PROPERTIES ENVIRONMENT "FLAGS_PIR_OPTEST_RELAX_CHECK=True")
else()
message(STATUS "PIR Relaxed OpTest: not found ${IR_OP_TEST} in legacy_test")
endif()
endforeach()

py_test_modules(test_stride MODULES test_stride ENVS
FLAGS_use_stride_kernel=true)

Expand All @@ -1448,3 +1413,5 @@ if((WITH_ROCM OR WITH_GPU) AND NOT WIN32)
test_fleet_executor_with_task_nodes
PROPERTIES ENVIRONMENT "FLAGS_new_executor_micro_batching=False")
endif()

set_pit_tests_properties()
2 changes: 0 additions & 2 deletions test/white_list/pir_op_test_white_list
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ test_auc_single_pred_op
test_bce_loss
test_bernoulli_op
test_bicubic_interp_v2_op
test_bilinear_interp_mkldnn_op
test_bilinear_interp_v2_mkldnn_op
test_bilinear_interp_v2_op
test_bilinear_tensor_product_op
Expand Down Expand Up @@ -167,7 +166,6 @@ test_index_select_op
test_instance_norm_op
test_instance_norm_op_v2
test_inverse_op
test_ir_pybind
test_is_empty_op
test_isclose_op
test_kldiv_loss_op
Expand Down