From 50ffb56be646fed72ec653238671f9ab55e5a73c Mon Sep 17 00:00:00 2001 From: tangshihua Date: Fri, 23 Dec 2022 09:56:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5master?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tangshihua --- .../common/mock_idevice.cpp | 4 +-- ai/neural_network_runtime/interface/BUILD.gn | 26 ++++++++++++------- .../interface/src/DeviceTest.cpp | 2 +- ai/neural_network_runtime/stability/BUILD.gn | 26 ++++++++++++------- 4 files changed, 35 insertions(+), 23 deletions(-) diff --git a/ai/neural_network_runtime/common/mock_idevice.cpp b/ai/neural_network_runtime/common/mock_idevice.cpp index dc88c673f..650c77aaf 100644 --- a/ai/neural_network_runtime/common/mock_idevice.cpp +++ b/ai/neural_network_runtime/common/mock_idevice.cpp @@ -80,13 +80,13 @@ void MockIDevice::SetDynamicInputSupported(bool isSupported) int32_t MockIDevice::GetDeviceName(std::string& name) { - name = "RK3568-CPU"; + name = "Device-CPU"; return HDF_SUCCESS; } int32_t MockIDevice::GetVendorName(std::string& name) { - name = "Rockchip"; + name = "TestVendor"; return HDF_SUCCESS; } diff --git a/ai/neural_network_runtime/interface/BUILD.gn b/ai/neural_network_runtime/interface/BUILD.gn index 319184e88..25b2fbd1a 100644 --- a/ai/neural_network_runtime/interface/BUILD.gn +++ b/ai/neural_network_runtime/interface/BUILD.gn @@ -13,8 +13,19 @@ import("//test/xts/tools/build/suite.gni") +config("nnrt_config") { + include_dirs = [ + "../common", + "//foundation/ai/neural_network_runtime", + "//foundation/ai/neural_network_runtime/third_party/include", + "//third_party/googletest/googletest/include", + "//third_party/googletest/googlemock/include", + "//third_party/mindspore/mindspore/lite/mindir/include", + ] + cflags = [ "-Wno-error" ] +} + ohos_moduletest_suite("ActsAiNnrtFunctionTest") { - testonly = true module_out_path = "acts/nnrt" sources = [ "../common/mock_idevice.cpp", @@ -26,14 +37,8 @@ ohos_moduletest_suite("ActsAiNnrtFunctionTest") { "src/ModelTest.cpp", ] - include_dirs = [ - "../common", - "//foundation/ai/neural_network_runtime", - "//foundation/ai/neural_network_runtime/third_party/include", - "//third_party/googletest/googletest/include", - "//third_party/googletest/googlemock/include", - "//third_party/mindspore/mindspore/lite/mindir/include", - ] + configs = [ ":nnrt_config" ] + deps = [ "//foundation/ai/neural_network_runtime/frameworks:libneural_network_runtime", "//third_party/googletest:gmock", @@ -51,5 +56,6 @@ ohos_moduletest_suite("ActsAiNnrtFunctionTest") { "mindspore:mindir", ] - cflags = [ "-Wno-error" ] + subsystem_name = "ai" + part_name = "neural_network_runtime" } diff --git a/ai/neural_network_runtime/interface/src/DeviceTest.cpp b/ai/neural_network_runtime/interface/src/DeviceTest.cpp index e8f849900..34534ebca 100644 --- a/ai/neural_network_runtime/interface/src/DeviceTest.cpp +++ b/ai/neural_network_runtime/interface/src/DeviceTest.cpp @@ -142,7 +142,7 @@ HWTEST_F(DeviceTest, SUB_AI_NNRt_Func_North_Device_DeviceName_0400, Function | M size_t targetDevice = devicesID[0]; const char *name = nullptr; - std::string m_deviceName{"RK3568-CPU_Rockchip"}; + std::string m_deviceName{"Device-CPU_TestVendor"}; OH_NN_ReturnCode ret = OH_NNDevice_GetName(targetDevice, &name); EXPECT_EQ(OH_NN_SUCCESS, ret); diff --git a/ai/neural_network_runtime/stability/BUILD.gn b/ai/neural_network_runtime/stability/BUILD.gn index 2ddde55b1..386e5475a 100644 --- a/ai/neural_network_runtime/stability/BUILD.gn +++ b/ai/neural_network_runtime/stability/BUILD.gn @@ -13,15 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_moduletest_suite("ActsAiNnrtStabilityTest") { - testonly = true - module_out_path = "acts/nnrt" - sources = [ - "../common/mock_idevice.cpp", - "../common/nnrt_utils.cpp", - "src/MultiThreadTest.cpp", - ] - +config("nnrt_config") { include_dirs = [ "../common", "//foundation/ai/neural_network_runtime", @@ -30,6 +22,19 @@ ohos_moduletest_suite("ActsAiNnrtStabilityTest") { "//third_party/googletest/googlemock/include", "//third_party/mindspore/mindspore/lite/mindir/include", ] + cflags = [ "-Wno-error" ] +} + +ohos_moduletest_suite("ActsAiNnrtStabilityTest") { + module_out_path = "acts/nnrt" + sources = [ + "../common/mock_idevice.cpp", + "../common/nnrt_utils.cpp", + "src/MultiThreadTest.cpp", + ] + + configs = [ ":nnrt_config" ] + deps = [ "//foundation/ai/neural_network_runtime/frameworks:libneural_network_runtime", "//third_party/googletest:gmock", @@ -47,5 +52,6 @@ ohos_moduletest_suite("ActsAiNnrtStabilityTest") { "mindspore:mindir", ] - cflags = [ "-Wno-error" ] + subsystem_name = "ai" + part_name = "neural_network_runtime" } -- GitLab