Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bf35515 authored by Jonathan Reichert's avatar Jonathan Reichert Committed by Automerger Merge Worker
Browse files

Merge "To skip VtsHalBootV1_1TargetTest for non Virtual A/B devices" am:...

Merge "To skip VtsHalBootV1_1TargetTest for non Virtual A/B devices" am: 309f5404 am: aa343b44 am: a22cfc1e

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2123570



Change-Id: Ie3e2a1aa4b68e565a81982943ad32d8d7aee9d9a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6f0775a6 a22cfc1e
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
/*

 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,6 +20,7 @@
#include <vector>

#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android/hardware/boot/1.1/IBootControl.h>
#include <android/hardware/boot/1.1/types.h>
#include <gmock/gmock.h>
@@ -37,9 +39,21 @@ using ::android::hardware::boot::V1_1::IBootControl;
using ::android::hardware::boot::V1_1::MergeStatus;
using ::testing::Contains;

bool IsVirtualAbEnabled();

#define SKIP_IF_NON_VIRTUAL_AB()                                                        \
    do {                                                                                \
        if (!IsVirtualAbEnabled()) GTEST_SKIP() << "Test for Virtual A/B devices only"; \
    } while (0)

bool IsVirtualAbEnabled() {
    return android::base::GetBoolProperty("ro.virtual_ab.enabled", false);
}

class BootHidlTest : public testing::TestWithParam<std::string> {
  public:
    virtual void SetUp() override {
        SKIP_IF_NON_VIRTUAL_AB();
        boot = IBootControl::getService(GetParam());
        ASSERT_NE(boot, nullptr);