diff --git a/cmake/generic.cmake b/cmake/generic.cmake index a5c74a46631e9d76fa78261f706a1853a80bab32..53dcde616b261da02cd2bab59fcb940cb66909a1 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -391,7 +391,7 @@ function(cc_binary TARGET_NAME) endfunction(cc_binary) function(cc_test_build TARGET_NAME) - if(WITH_TESTING) + if(WITH_TESTING AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON") set(oneValueArgs "") set(multiValueArgs SRCS DEPS) cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -409,14 +409,12 @@ function(cc_test_build TARGET_NAME) if(WITH_ROCM) target_link_libraries(${TARGET_NAME} ${ROCM_HIPRTC_LIB}) endif() + check_coverage_opt(${TARGET_NAME} ${cc_test_SRCS}) endif() - - check_coverage_opt(${TARGET_NAME} ${cc_test_SRCS}) - endfunction() function(cc_test_run TARGET_NAME) - if(WITH_TESTING) + if(WITH_TESTING AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON") set(oneValueArgs "") set(multiValueArgs COMMAND ARGS) cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) diff --git a/paddle/fluid/inference/api/CMakeLists.txt b/paddle/fluid/inference/api/CMakeLists.txt index 82c95ba2c95712d2ebe3aa80286689028febf3fe..c7d947c58039efa80d5b8336bc5db99cd89cee82 100755 --- a/paddle/fluid/inference/api/CMakeLists.txt +++ b/paddle/fluid/inference/api/CMakeLists.txt @@ -71,7 +71,7 @@ elseif (WIN32) cc_test(test_analysis_predictor SRCS analysis_predictor_tester.cc DEPS analysis_predictor benchmark ${inference_deps} ARGS --dirname=${WORD2VEC_MODEL_DIR}) endif() -if(WITH_TESTING) +if(WITH_TESTING AND TEST test_api_impl) if(NOT APPLE) set_tests_properties(test_api_impl PROPERTIES TIMEOUT 120) endif() diff --git a/paddle/fluid/inference/tests/api/CMakeLists.txt b/paddle/fluid/inference/tests/api/CMakeLists.txt index f74cd671d6dca0cd52bb595f6ee1370b464d9e30..60479f806f36676beb8c600850b94eb1db7260d9 100644 --- a/paddle/fluid/inference/tests/api/CMakeLists.txt +++ b/paddle/fluid/inference/tests/api/CMakeLists.txt @@ -242,10 +242,10 @@ download_result(${ERNIE_INSTALL_DIR} "Ernie_large_result.txt.tar.gz") inference_analysis_test(test_analyzer_ernie_large SRCS analyzer_ernie_tester.cc EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} ARGS --infer_model=${ERNIE_INSTALL_DIR}/model --infer_data=${ERNIE_INSTALL_DIR}/data.txt --refer_result=${ERNIE_INSTALL_DIR}/result.txt --ernie_large=true) -if(NOT WIN32 AND NOT APPLE) +if(NOT WIN32 AND NOT APPLE AND TEST test_analyzer_ernie_large) set_tests_properties(test_analyzer_ernie_large PROPERTIES TIMEOUT 150 LABELS "RUN_TYPE=NIGHTLY") endif() -if (WIN32) +if (WIN32 AND TEST test_analyzer_ernie_large) set_tests_properties(test_analyzer_ernie_large PROPERTIES TIMEOUT 200) endif() @@ -645,6 +645,10 @@ if(WITH_GPU) ARGS --infer_model=${RESNET50_MODEL_DIR}) endif() +if("$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON") + return() +endif() + if(WITH_GPU AND TENSORRT_FOUND) set_tests_properties(trt_resnext_test PROPERTIES TIMEOUT 300) set_tests_properties(trt_quant_int8_yolov3_r50_test PROPERTIES TIMEOUT 300)