diff --git a/build.gni b/build.gni index 4c8d29bc..41037541 100644 --- a/build.gni +++ b/build.gni @@ -15,4 +15,5 @@ declare_args() { hats_rich = false hats_nnrt = false hats_drivers_peripheral_power_wakeup_cause_path = false + hats_drivers_peripheral_battery_pc_macro_isolation = false } diff --git a/bundle.json b/bundle.json index d277a744..f397f13c 100644 --- a/bundle.json +++ b/bundle.json @@ -16,7 +16,8 @@ "features": [ "hats_rich", "hats_nnrt", - "hats_drivers_peripheral_power_wakeup_cause_path" + "hats_drivers_peripheral_power_wakeup_cause_path", + "hats_drivers_peripheral_battery_pc_macro_isolation" ], "adapted_system_type": [ "mini", diff --git a/powermgr/battery/hdi_battery/BUILD.gn b/powermgr/battery/hdi_battery/BUILD.gn index 84f2dde9..627497e4 100755 --- a/powermgr/battery/hdi_battery/BUILD.gn +++ b/powermgr/battery/hdi_battery/BUILD.gn @@ -13,6 +13,7 @@ import("//build/ohos_var.gni") import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") +import("//test/xts/hats/build.gni") import("//test/xts/tools/build/suite.gni") ohos_moduletest_suite("HatsPowermgrBatteryTest") { @@ -29,6 +30,11 @@ ohos_moduletest_suite("HatsPowermgrBatteryTest") { "hilog:libhilog", "ipc:ipc_single", ] + + if (hats_drivers_peripheral_battery_pc_macro_isolation) { + defines = [ "HATS_DRIVERS_PERIPHERAL_BATTERY_PC_MACRO_ISOLATION" ] + } + subsystem_name = "xts" part_name = "hats" } diff --git a/powermgr/battery/hdi_battery/common/hdi_battery_test.cpp b/powermgr/battery/hdi_battery/common/hdi_battery_test.cpp index 1421039a..738a8a8b 100644 --- a/powermgr/battery/hdi_battery/common/hdi_battery_test.cpp +++ b/powermgr/battery/hdi_battery/common/hdi_battery_test.cpp @@ -272,8 +272,11 @@ HWTEST_F(HdfBatteryHdiTest, HdfBatteryHdiTest014, TestSize.Level1) printf("HdfBatteryHdiTest014: start."); int curAverage = -1; int32_t ret = g_batteryInterface->GetCurrentAverage(curAverage); +#ifdef HATS_DRIVERS_PERIPHERAL_BATTERY_PC_MACRO_ISOLATION + EXPECT_NE(0, curAverage); +#else EXPECT_EQ(0, ret); - +#endif printf("HdfBatteryHdiTest014: return."); }