提交 50ffb56b 编写于 作者: T tangshihua

同步master

Signed-off-by: Ntangshihua <tangshihua@huawei.com>
上级 db38d810
...@@ -80,13 +80,13 @@ void MockIDevice::SetDynamicInputSupported(bool isSupported) ...@@ -80,13 +80,13 @@ void MockIDevice::SetDynamicInputSupported(bool isSupported)
int32_t MockIDevice::GetDeviceName(std::string& name) int32_t MockIDevice::GetDeviceName(std::string& name)
{ {
name = "RK3568-CPU"; name = "Device-CPU";
return HDF_SUCCESS; return HDF_SUCCESS;
} }
int32_t MockIDevice::GetVendorName(std::string& name) int32_t MockIDevice::GetVendorName(std::string& name)
{ {
name = "Rockchip"; name = "TestVendor";
return HDF_SUCCESS; return HDF_SUCCESS;
} }
......
...@@ -13,8 +13,19 @@ ...@@ -13,8 +13,19 @@
import("//test/xts/tools/build/suite.gni") 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") { ohos_moduletest_suite("ActsAiNnrtFunctionTest") {
testonly = true
module_out_path = "acts/nnrt" module_out_path = "acts/nnrt"
sources = [ sources = [
"../common/mock_idevice.cpp", "../common/mock_idevice.cpp",
...@@ -26,14 +37,8 @@ ohos_moduletest_suite("ActsAiNnrtFunctionTest") { ...@@ -26,14 +37,8 @@ ohos_moduletest_suite("ActsAiNnrtFunctionTest") {
"src/ModelTest.cpp", "src/ModelTest.cpp",
] ]
include_dirs = [ configs = [ ":nnrt_config" ]
"../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",
]
deps = [ deps = [
"//foundation/ai/neural_network_runtime/frameworks:libneural_network_runtime", "//foundation/ai/neural_network_runtime/frameworks:libneural_network_runtime",
"//third_party/googletest:gmock", "//third_party/googletest:gmock",
...@@ -51,5 +56,6 @@ ohos_moduletest_suite("ActsAiNnrtFunctionTest") { ...@@ -51,5 +56,6 @@ ohos_moduletest_suite("ActsAiNnrtFunctionTest") {
"mindspore:mindir", "mindspore:mindir",
] ]
cflags = [ "-Wno-error" ] subsystem_name = "ai"
part_name = "neural_network_runtime"
} }
...@@ -142,7 +142,7 @@ HWTEST_F(DeviceTest, SUB_AI_NNRt_Func_North_Device_DeviceName_0400, Function | M ...@@ -142,7 +142,7 @@ HWTEST_F(DeviceTest, SUB_AI_NNRt_Func_North_Device_DeviceName_0400, Function | M
size_t targetDevice = devicesID[0]; size_t targetDevice = devicesID[0];
const char *name = nullptr; 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); OH_NN_ReturnCode ret = OH_NNDevice_GetName(targetDevice, &name);
EXPECT_EQ(OH_NN_SUCCESS, ret); EXPECT_EQ(OH_NN_SUCCESS, ret);
......
...@@ -13,15 +13,7 @@ ...@@ -13,15 +13,7 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_moduletest_suite("ActsAiNnrtStabilityTest") { config("nnrt_config") {
testonly = true
module_out_path = "acts/nnrt"
sources = [
"../common/mock_idevice.cpp",
"../common/nnrt_utils.cpp",
"src/MultiThreadTest.cpp",
]
include_dirs = [ include_dirs = [
"../common", "../common",
"//foundation/ai/neural_network_runtime", "//foundation/ai/neural_network_runtime",
...@@ -30,6 +22,19 @@ ohos_moduletest_suite("ActsAiNnrtStabilityTest") { ...@@ -30,6 +22,19 @@ ohos_moduletest_suite("ActsAiNnrtStabilityTest") {
"//third_party/googletest/googlemock/include", "//third_party/googletest/googlemock/include",
"//third_party/mindspore/mindspore/lite/mindir/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 = [ deps = [
"//foundation/ai/neural_network_runtime/frameworks:libneural_network_runtime", "//foundation/ai/neural_network_runtime/frameworks:libneural_network_runtime",
"//third_party/googletest:gmock", "//third_party/googletest:gmock",
...@@ -47,5 +52,6 @@ ohos_moduletest_suite("ActsAiNnrtStabilityTest") { ...@@ -47,5 +52,6 @@ ohos_moduletest_suite("ActsAiNnrtStabilityTest") {
"mindspore:mindir", "mindspore:mindir",
] ]
cflags = [ "-Wno-error" ] subsystem_name = "ai"
part_name = "neural_network_runtime"
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册