diff --git a/lite/tests/api/CMakeLists.txt b/lite/tests/api/CMakeLists.txt index 636d9d557400152c871bded938f26f74e282dd1e..cbfe3bc63268d8565e5882a11831b17ec249ba14 100644 --- a/lite/tests/api/CMakeLists.txt +++ b/lite/tests/api/CMakeLists.txt @@ -8,18 +8,17 @@ function(lite_cc_test_with_model_and_data TARGET) set(multiValueArgs "") cmake_parse_arguments(args "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(ARGS "") if(DEFINED args_MODEL) - set(ARGS "${ARGS} --model_dir=${LITE_MODEL_DIR}/${args_MODEL}") + set(ARGS ${ARGS} --model_dir=${LITE_MODEL_DIR}/${args_MODEL}) endif() if(DEFINED args_DATA) - set(ARGS "${ARGS} --data_dir=${LITE_MODEL_DIR}/${args_DATA}") + set(ARGS ${ARGS} --data_dir=${LITE_MODEL_DIR}/${args_DATA}) endif() if(DEFINED args_CONFIG) - set(ARGS "${ARGS} --config_dir=${LITE_MODEL_DIR}/${args_CONFIG}") + set(ARGS ${ARGS} --config_dir=${LITE_MODEL_DIR}/${args_CONFIG}) endif() if(DEFINED args_ARGS) - set(ARGS "${ARGS} ${args_ARGS}") + set(ARGS ${ARGS} ${args_ARGS}) endif() lite_cc_test(${TARGET} SRCS ${TARGET}.cc DEPS ${lite_model_test_DEPS} paddle_api_full @@ -45,7 +44,7 @@ function(lite_cc_test_with_model_and_data TARGET) endfunction() if(LITE_WITH_ARM) - lite_cc_test_with_model_and_data(test_transformer_with_mask_fp32_arm MODEL transformer_with_mask_fp32 ARGS) + lite_cc_test_with_model_and_data(test_transformer_with_mask_fp32_arm MODEL transformer_with_mask_fp32) endif() if(LITE_WITH_NPU) @@ -55,11 +54,11 @@ if(LITE_WITH_NPU) endif() if(LITE_WITH_XPU AND NOT LITE_WITH_XTCL) - lite_cc_test_with_model_and_data(test_resnet50_fp32_xpu MODEL resnet50 DATA ILSVRC2012_small) - lite_cc_test_with_model_and_data(test_googlenet_fp32_xpu MODEL GoogLeNet DATA ILSVRC2012_small) - lite_cc_test_with_model_and_data(test_vgg19_fp32_xpu MODEL VGG19 DATA ILSVRC2012_small) - lite_cc_test_with_model_and_data(test_ernie_fp32_xpu MODEL ernie DATA bert_data) - lite_cc_test_with_model_and_data(test_bert_fp32_xpu MODEL bert DATA bert_data) + lite_cc_test_with_model_and_data(test_resnet50_fp32_baidu_xpu MODEL resnet50 DATA ILSVRC2012_small) + lite_cc_test_with_model_and_data(test_googlenet_fp32_baidu_xpu MODEL GoogLeNet DATA ILSVRC2012_small) + lite_cc_test_with_model_and_data(test_vgg19_fp32_baidu_xpu MODEL VGG19 DATA ILSVRC2012_small) + lite_cc_test_with_model_and_data(test_ernie_fp32_baidu_xpu MODEL ernie DATA bert_data) + lite_cc_test_with_model_and_data(test_bert_fp32_baidu_xpu MODEL bert DATA bert_data) endif() if(LITE_WITH_RKNPU) diff --git a/lite/tests/api/test_bert_fp32_xpu.cc b/lite/tests/api/test_bert_fp32_baidu_xpu.cc similarity index 98% rename from lite/tests/api/test_bert_fp32_xpu.cc rename to lite/tests/api/test_bert_fp32_baidu_xpu.cc index 63d8954fb9c4b57330ca137899ad8fc7bbc5275b..451ba5bcbdbefeb7053f1416e6275d4247ae9a7d 100644 --- a/lite/tests/api/test_bert_fp32_xpu.cc +++ b/lite/tests/api/test_bert_fp32_baidu_xpu.cc @@ -30,7 +30,7 @@ DEFINE_int32(iteration, 9, "iteration times to run"); namespace paddle { namespace lite { -TEST(Bert, test_bert_fp32_xpu) { +TEST(Bert, test_bert_fp32_baidu_xpu) { lite_api::CxxConfig config; config.set_model_dir(FLAGS_model_dir); config.set_valid_places({lite_api::Place{TARGET(kXPU), PRECISION(kFloat)}, diff --git a/lite/tests/api/test_ernie_fp32_xpu.cc b/lite/tests/api/test_ernie_fp32_baidu_xpu.cc similarity index 98% rename from lite/tests/api/test_ernie_fp32_xpu.cc rename to lite/tests/api/test_ernie_fp32_baidu_xpu.cc index 864bc922f7ffb1b04612870209e6f19bea0e1111..d5f3c818aa03f2401ac784f3302da59b831b5d9d 100644 --- a/lite/tests/api/test_ernie_fp32_xpu.cc +++ b/lite/tests/api/test_ernie_fp32_baidu_xpu.cc @@ -41,7 +41,7 @@ lite::Tensor GetTensorWithShape(std::vector shape) { return ret; } -TEST(Ernie, test_ernie_fp32_xpu) { +TEST(Ernie, test_ernie_fp32_baidu_xpu) { lite_api::CxxConfig config; config.set_model_dir(FLAGS_model_dir); config.set_valid_places({lite_api::Place{TARGET(kXPU), PRECISION(kFloat)}, diff --git a/lite/tests/api/test_fpr_fp32_xpu.cc b/lite/tests/api/test_fpr_fp32_baidu_xpu.cc similarity index 97% rename from lite/tests/api/test_fpr_fp32_xpu.cc rename to lite/tests/api/test_fpr_fp32_baidu_xpu.cc index 5c7546ba2245c5b1102a1c8fbfd0fba703c0c6fa..074b80bb8a6876ba569c0c1a060e27d3c2a4d865 100644 --- a/lite/tests/api/test_fpr_fp32_xpu.cc +++ b/lite/tests/api/test_fpr_fp32_baidu_xpu.cc @@ -26,7 +26,7 @@ namespace paddle { namespace lite { -TEST(ResnetCbam, test_resnet_cbam_fp32_xpu) { +TEST(ResnetCbam, test_resnet_cbam_fp32_baidu_xpu) { lite_api::CxxConfig config; // config.set_model_dir(FLAGS_model_dir); config.set_model_file(FLAGS_model_dir + "/__model__"); diff --git a/lite/tests/api/test_googlenet_fp32_xpu.cc b/lite/tests/api/test_googlenet_fp32_baidu_xpu.cc similarity index 98% rename from lite/tests/api/test_googlenet_fp32_xpu.cc rename to lite/tests/api/test_googlenet_fp32_baidu_xpu.cc index de5979d0b93956ef11ab7f0488527ec876ed580c..1fd671f37c7debd0cb4044b083c955407021e912 100644 --- a/lite/tests/api/test_googlenet_fp32_xpu.cc +++ b/lite/tests/api/test_googlenet_fp32_baidu_xpu.cc @@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel"); namespace paddle { namespace lite { -TEST(GoogLeNet, test_googlenet_fp32_xpu) { +TEST(GoogLeNet, test_googlenet_fp32_baidu_xpu) { lite_api::CxxConfig config; config.set_model_dir(FLAGS_model_dir); config.set_valid_places({lite_api::Place{TARGET(kXPU), PRECISION(kFloat)}, diff --git a/lite/tests/api/test_mmdnn_fp32_xpu.cc b/lite/tests/api/test_mmdnn_fp32_baidu_xpu.cc similarity index 99% rename from lite/tests/api/test_mmdnn_fp32_xpu.cc rename to lite/tests/api/test_mmdnn_fp32_baidu_xpu.cc index 95e390b23fa6dda45a3ef47b60d054923e399189..6ac8cca8c749ea0b3d793036e78e1bfdeb21d476 100644 --- a/lite/tests/api/test_mmdnn_fp32_xpu.cc +++ b/lite/tests/api/test_mmdnn_fp32_baidu_xpu.cc @@ -199,7 +199,7 @@ class FileReader { } }; -TEST(MMDNN, test_mmdnn_fp32_xpu) { +TEST(MMDNN, test_mmdnn_fp32_baidu_xpu) { lite_api::CxxConfig config; // config.set_model_dir(FLAGS_model_dir); config.set_model_file(FLAGS_model_dir + "/__model__"); diff --git a/lite/tests/api/test_resnet50_fp32_xpu.cc b/lite/tests/api/test_resnet50_fp32_baidu_xpu.cc similarity index 98% rename from lite/tests/api/test_resnet50_fp32_xpu.cc rename to lite/tests/api/test_resnet50_fp32_baidu_xpu.cc index 795a8fe5c8965d3f9f6116af47a27be763ecf549..51697abf14f80c3b4d9f565e937b5b0c33a491be 100644 --- a/lite/tests/api/test_resnet50_fp32_xpu.cc +++ b/lite/tests/api/test_resnet50_fp32_baidu_xpu.cc @@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel"); namespace paddle { namespace lite { -TEST(Resnet50, test_resnet50_fp32_xpu) { +TEST(Resnet50, test_resnet50_fp32_baidu_xpu) { lite_api::CxxConfig config; config.set_model_dir(FLAGS_model_dir); config.set_valid_places({lite_api::Place{TARGET(kXPU), PRECISION(kFloat)}, diff --git a/lite/tests/api/test_vgg19_fp32_xpu.cc b/lite/tests/api/test_vgg19_fp32_baidu_xpu.cc similarity index 98% rename from lite/tests/api/test_vgg19_fp32_xpu.cc rename to lite/tests/api/test_vgg19_fp32_baidu_xpu.cc index 71c086dda9f561f9932123de5c20f48979ec9dc0..b4e68fda6a23699b5b8fed4b34eae987ff2a3577 100644 --- a/lite/tests/api/test_vgg19_fp32_xpu.cc +++ b/lite/tests/api/test_vgg19_fp32_baidu_xpu.cc @@ -32,7 +32,7 @@ DEFINE_int32(channel, 3, "image channel"); namespace paddle { namespace lite { -TEST(VGG19, test_vgg19_fp32_xpu) { +TEST(VGG19, test_vgg19_fp32_baidu_xpu) { lite_api::CxxConfig config; config.set_model_dir(FLAGS_model_dir); config.set_valid_places({lite_api::Place{TARGET(kXPU), PRECISION(kFloat)}, diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index d5d8fd6c461b70f9ba1d6901c519f96e5022f008..14417abacb70d57c76632bc229a582db998e95fe 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -564,6 +564,8 @@ function run_all_tests_on_adb_device { fi # Extract the arguments from ctest command line test_args=$(echo $(ctest -V -N -R ${test_name}) | sed "/.*${test_name} \"\(.*\)\".*/ s//\1/g") + # Remove the quotes + test_args=$(echo $test_args | sed "s/\"//g") run_test_case_on_adb_device --adb_device_name=$adb_device_name --adb_work_dir=$adb_work_dir --target_name=$test_name $test_args done cd - > /dev/null