From 75967d352b5e3f1058cbab5d3e5840d6ec83626c Mon Sep 17 00:00:00 2001 From: ling Date: Tue, 28 Sep 2021 14:19:10 +0800 Subject: [PATCH] [MSLITE] enable runtime allocator testcase --- mindspore/lite/test/CMakeLists.txt | 12 ++++++------ mindspore/lite/test/runtest.sh | 1 + mindspore/lite/test/ut/scripts/run_ut_arm64.sh | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mindspore/lite/test/CMakeLists.txt b/mindspore/lite/test/CMakeLists.txt index 4ced2eac99d..f585c2373d0 100644 --- a/mindspore/lite/test/CMakeLists.txt +++ b/mindspore/lite/test/CMakeLists.txt @@ -119,12 +119,12 @@ add_dependencies(lite-test fbs_src fbs_inner_src) target_link_libraries(lite-test mindspore-lite dl mindspore::gtest) -## test file using gmock -#target_link_libraries(lite-test mindspore::gmock) -#add_library(gmock_tests OBJECT ${TEST_DIR}/st/optimize_allocator_test.cc) -#add_dependencies(gmock_tests fbs_src fbs_inner_src) -#target_compile_options(gmock_tests PRIVATE -fno-rtti) -#target_link_libraries(lite-test gmock_tests) +# test file using gmock +target_link_libraries(lite-test mindspore::gmock) +add_library(gmock_tests OBJECT ${TEST_DIR}/st/optimize_allocator_test.cc) +add_dependencies(gmock_tests fbs_src fbs_inner_src) +target_compile_options(gmock_tests PRIVATE -fno-rtti) +target_link_libraries(lite-test gmock_tests) if(MSLITE_ENABLE_TRAIN) target_link_libraries(lite-test mindspore-lite-train minddata-lite) diff --git a/mindspore/lite/test/runtest.sh b/mindspore/lite/test/runtest.sh index a85b3732905..4771feb43d6 100644 --- a/mindspore/lite/test/runtest.sh +++ b/mindspore/lite/test/runtest.sh @@ -13,6 +13,7 @@ mkdir -pv ${CUR_DIR}/do_test cd ${CUR_DIR}/do_test cp ${BUILD_DIR}/test/lite-test ./ cp ${BUILD_DIR}/googletest/googlemock/gtest/libgtest.so ./ +cp ${BUILD_DIR}/googletest/googlemock/gtest/libgmock.so ./ ls -l *.so* export LD_LIBRARY_PATH=./:${TENSORRT_PATH}/lib:${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} diff --git a/mindspore/lite/test/ut/scripts/run_ut_arm64.sh b/mindspore/lite/test/ut/scripts/run_ut_arm64.sh index eeccd9770b9..05a891516d1 100755 --- a/mindspore/lite/test/ut/scripts/run_ut_arm64.sh +++ b/mindspore/lite/test/ut/scripts/run_ut_arm64.sh @@ -43,6 +43,7 @@ function Run_arm64_ut() { echo 'cd /data/local/tmp/ut_test' > adb_cmd.txt echo 'cp /data/local/tmp/libc++_shared.so ./' >> adb_cmd.txt echo 'cp /data/local/tmp/libgtest.so ./' >> adb_cmd.txt + echo 'cp /data/local/tmp/libgmock.so ./' >> adb_cmd.txt echo 'chmod 777 lite-test' >> adb_cmd.txt adb -s ${device_id} shell < adb_cmd.txt