未验证 提交 d1cc772b 编写于 作者: I iducn 提交者: GitHub

[Inference] [unittest] Inference unit tests rely on dynamic libraries (2) (#24859) (#26010)

Co-authored-by: NWilber <jiweibo@baidu.com>
上级 eae8f4e3
...@@ -60,7 +60,14 @@ function(inference_analysis_test TARGET) ...@@ -60,7 +60,14 @@ function(inference_analysis_test TARGET)
endif() endif()
endfunction(inference_analysis_test) endfunction(inference_analysis_test)
inference_analysis_test(test_analyzer if (NOT APPLE AND NOT WIN32)
SRCS analyzer_tester.cc inference_analysis_test(test_analyzer
EXTRA_DEPS reset_tensor_array paddle_inference_api SRCS analyzer_tester.cc
ARGS --inference_model_dir=${WORD2VEC_MODEL_DIR}) EXTRA_DEPS reset_tensor_array paddle_fluid_shared
ARGS --inference_model_dir=${WORD2VEC_MODEL_DIR})
else()
inference_analysis_test(test_analyzer
SRCS analyzer_tester.cc
EXTRA_DEPS reset_tensor_array paddle_inference_api
ARGS --inference_model_dir=${WORD2VEC_MODEL_DIR})
endif()
...@@ -14,10 +14,17 @@ function(train_test TARGET_NAME) ...@@ -14,10 +14,17 @@ function(train_test TARGET_NAME)
endif() endif()
foreach(arg ${arg_list}) foreach(arg ${arg_list})
string(REGEX REPLACE "^_$" "" arg "${arg}") string(REGEX REPLACE "^_$" "" arg "${arg}")
cc_test(test_train_${TARGET_NAME}${arg} if (NOT APPLE AND NOT WIN32)
SRCS test_train_${TARGET_NAME}.cc cc_test(test_train_${TARGET_NAME}${arg}
DEPS paddle_fluid_api SRCS test_train_${TARGET_NAME}.cc
ARGS --dirname=${PYTHON_TESTS_DIR}/book/${TARGET_NAME}${arg}.train.model/) DEPS paddle_fluid_shared
ARGS --dirname=${PYTHON_TESTS_DIR}/book/${TARGET_NAME}${arg}.train.model/)
else()
cc_test(test_train_${TARGET_NAME}${arg}
SRCS test_train_${TARGET_NAME}.cc
DEPS paddle_fluid_api
ARGS --dirname=${PYTHON_TESTS_DIR}/book/${TARGET_NAME}${arg}.train.model/)
endif()
set_tests_properties(test_train_${TARGET_NAME}${arg} set_tests_properties(test_train_${TARGET_NAME}${arg}
PROPERTIES DEPENDS test_${TARGET_NAME}) PROPERTIES DEPENDS test_${TARGET_NAME})
set_tests_properties(test_train_${TARGET_NAME}${arg} set_tests_properties(test_train_${TARGET_NAME}${arg}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册