未验证 提交 fa75ebeb 编写于 作者: R risemeup1 提交者: GitHub

link C++ tests to libpaddle.so (#56829)

* link C++ tests to libpaddle.so except windows

* fix compile kill-9 bug

* fix compile kill-9 bug

* fix compile kill-9 bug

* fix compile kill-9 bug
上级 e110cbb4
get_property(paddle_lib GLOBAL PROPERTY PADDLE_LIB_NAME)
set_source_files_properties( set_source_files_properties(
interceptor_ping_pong_test.cc PROPERTIES COMPILE_FLAGS interceptor_ping_pong_test.cc PROPERTIES COMPILE_FLAGS
${DISTRIBUTE_COMPILE_FLAGS}) ${DISTRIBUTE_COMPILE_FLAGS})
cc_test_old(interceptor_ping_pong_test SRCS interceptor_ping_pong_test.cc DEPS if(WIN32 AND WITH_TESTING)
fleet_executor ${BRPC_DEPS}) cc_test_old(interceptor_ping_pong_test SRCS interceptor_ping_pong_test.cc
DEPS fleet_executor ${BRPC_DEPS})
else()
cc_test_old(
interceptor_ping_pong_test
SRCS
interceptor_ping_pong_test.cc
DEPS
${paddle_lib}
python
fleet_executor)
endif()
set_source_files_properties( set_source_files_properties(
compute_interceptor_test.cc PROPERTIES COMPILE_FLAGS compute_interceptor_test.cc PROPERTIES COMPILE_FLAGS
${DISTRIBUTE_COMPILE_FLAGS}) ${DISTRIBUTE_COMPILE_FLAGS})
cc_test_old(compute_interceptor_test SRCS compute_interceptor_test.cc DEPS
fleet_executor ${BRPC_DEPS}) if(WIN32 AND WITH_TESTING)
cc_test_old(compute_interceptor_test SRCS compute_interceptor_test.cc DEPS
fleet_executor ${BRPC_DEPS})
else()
cc_test_old(
compute_interceptor_test
SRCS
compute_interceptor_test.cc
DEPS
${paddle_lib}
python
fleet_executor)
endif()
set_source_files_properties( set_source_files_properties(
source_interceptor_test.cc PROPERTIES COMPILE_FLAGS source_interceptor_test.cc PROPERTIES COMPILE_FLAGS
${DISTRIBUTE_COMPILE_FLAGS}) ${DISTRIBUTE_COMPILE_FLAGS})
cc_test_old(source_interceptor_test SRCS source_interceptor_test.cc DEPS if(WIN32 AND WITH_TESTING)
fleet_executor ${BRPC_DEPS}) cc_test_old(source_interceptor_test SRCS source_interceptor_test.cc DEPS
fleet_executor ${BRPC_DEPS})
else()
cc_test_old(
source_interceptor_test
SRCS
source_interceptor_test.cc
DEPS
${paddle_lib}
python
fleet_executor)
endif()
set_source_files_properties( set_source_files_properties(
sink_interceptor_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) sink_interceptor_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
cc_test_old(sink_interceptor_test SRCS sink_interceptor_test.cc DEPS if(WIN32 AND WITH_TESTING)
fleet_executor ${BRPC_DEPS}) cc_test_old(sink_interceptor_test SRCS sink_interceptor_test.cc DEPS
fleet_executor ${BRPC_DEPS})
else()
cc_test_old(
sink_interceptor_test
SRCS
sink_interceptor_test.cc
DEPS
${paddle_lib}
python
fleet_executor)
endif()
set_source_files_properties( set_source_files_properties(
interceptor_pipeline_short_path_test.cc interceptor_pipeline_short_path_test.cc
PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
cc_test_old( if(WIN32 AND WITH_TESTING)
interceptor_pipeline_short_path_test SRCS cc_test_old(
interceptor_pipeline_short_path_test.cc DEPS fleet_executor ${BRPC_DEPS}) interceptor_pipeline_short_path_test SRCS
interceptor_pipeline_short_path_test.cc DEPS fleet_executor ${BRPC_DEPS})
else()
cc_test_old(
interceptor_pipeline_short_path_test
SRCS
interceptor_pipeline_short_path_test.cc
DEPS
${paddle_lib}
python
fleet_executor)
endif()
set_source_files_properties( set_source_files_properties(
interceptor_pipeline_long_path_test.cc PROPERTIES COMPILE_FLAGS interceptor_pipeline_long_path_test.cc PROPERTIES COMPILE_FLAGS
${DISTRIBUTE_COMPILE_FLAGS}) ${DISTRIBUTE_COMPILE_FLAGS})
cc_test_old( if(WIN32 AND WITH_TESTING)
interceptor_pipeline_long_path_test SRCS cc_test_old(
interceptor_pipeline_long_path_test.cc DEPS fleet_executor ${BRPC_DEPS}) interceptor_pipeline_long_path_test SRCS
interceptor_pipeline_long_path_test.cc DEPS fleet_executor ${BRPC_DEPS})
else()
cc_test_old(
interceptor_pipeline_long_path_test
SRCS
interceptor_pipeline_long_path_test.cc
DEPS
${paddle_lib}
python
fleet_executor)
endif()
set_source_files_properties( set_source_files_properties(
compute_interceptor_run_op_test.cc PROPERTIES COMPILE_FLAGS compute_interceptor_run_op_test.cc PROPERTIES COMPILE_FLAGS
${DISTRIBUTE_COMPILE_FLAGS}) ${DISTRIBUTE_COMPILE_FLAGS})
cc_test_old( if(WIN32 AND WITH_TESTING)
compute_interceptor_run_op_test cc_test_old(
SRCS compute_interceptor_run_op_test
compute_interceptor_run_op_test.cc SRCS
DEPS compute_interceptor_run_op_test.cc
fleet_executor DEPS
naive_executor fleet_executor
fill_constant_op naive_executor
op_registry fill_constant_op
elementwise_add_op op_registry
scope elementwise_add_op
device_context scope
${BRPC_DEPS}) device_context
${BRPC_DEPS})
else()
cc_test_old(
compute_interceptor_run_op_test
SRCS
compute_interceptor_run_op_test.cc
DEPS
${paddle_lib}
python
fleet_executor
fill_constant_op
elementwise_add_op)
endif()
if(WITH_DISTRIBUTE AND NOT WITH_PSLIB) if(WITH_DISTRIBUTE AND NOT WITH_PSLIB)
set_source_files_properties( set_source_files_properties(
interceptor_ping_pong_with_brpc_test.cc interceptor_ping_pong_with_brpc_test.cc
PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
cc_test_old( if(WIN32 AND WITH_TESTING)
interceptor_ping_pong_with_brpc_test SRCS cc_test_old(
interceptor_ping_pong_with_brpc_test.cc DEPS fleet_executor ${BRPC_DEPS}) interceptor_ping_pong_with_brpc_test SRCS
interceptor_ping_pong_with_brpc_test.cc DEPS fleet_executor ${BRPC_DEPS})
else()
cc_test_old(
interceptor_ping_pong_with_brpc_test
SRCS
interceptor_ping_pong_with_brpc_test.cc
DEPS
${paddle_lib}
python
fleet_executor)
endif()
endif() endif()
get_property(paddle_lib GLOBAL PROPERTY PADDLE_LIB_NAME)
cc_test( cc_test(
test_mkldnn_op_inplace test_mkldnn_op_inplace
SRCS test_mkldnn_op_inplace.cc SRCS test_mkldnn_op_inplace.cc
...@@ -41,33 +42,7 @@ cc_test( ...@@ -41,33 +42,7 @@ cc_test(
test_mkldnn_caching test_mkldnn_caching
SRCS test_mkldnn_caching.cc SRCS test_mkldnn_caching.cc
DEPS ${TEST_MKLDNN_CACHING_DEPS}) DEPS ${TEST_MKLDNN_CACHING_DEPS})
if(WITH_CINN) if(WIN32 AND WITH_TESTING)
cc_test_old(
test_mkldnn_op_nhwc
SRCS
test_mkldnn_op_nhwc.cc
DEPS
fleet_executor
conditional_block_op
standalone_executor
executor
recurrent_op_helper
cinn_compiler
recurrent_op
op_registry
generated_static_op
crop_op
activation_op
generated_op
generated_static_op
phi
transpose_op
fused_transpose_op
scope
device_context
enforce
python)
else()
cc_test_old( cc_test_old(
test_mkldnn_op_nhwc test_mkldnn_op_nhwc
SRCS SRCS
...@@ -91,4 +66,7 @@ else() ...@@ -91,4 +66,7 @@ else()
scope scope
device_context device_context
enforce) enforce)
else()
cc_test_old(test_mkldnn_op_nhwc SRCS test_mkldnn_op_nhwc.cc DEPS
${paddle_lib} python)
endif() endif()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册