Skip test when NAN or RTT feature not supported

Bug: 155372761
Test: atest VtsHalWifiApV1_4TargetTest, VtsHalWifiNanV1_4TargetTest, VtsHalWifiRttV1_4TargetTest
SingleDeviceTest
Merged-In: I04bfffe9dc587e3f7209601c3712422b6e2d165c
Change-Id: I04bfffe9dc587e3f7209601c3712422b6e2d165c
This commit is contained in:
Nate Jiang 2020-05-14 18:06:26 -07:00
parent 74b04e9649
commit 8c0fec12ec
7 changed files with 46 additions and 16 deletions

View file

@ -23,14 +23,14 @@ cc_library_static {
"wifi_hidl_test_utils.cpp",
],
export_include_dirs: [
"."
".",
],
shared_libs: [
"libnativehelper",
],
static_libs: [
"android.hardware.wifi@1.0",
"libwifi-system-iface"
"libwifi-system-iface",
],
}
@ -49,9 +49,12 @@ cc_test {
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"android.hardware.wifi@1.3",
"libwifi-system-iface"
"libwifi-system-iface",
],
test_suites: [
"general-tests",
"vts",
],
test_suites: ["general-tests", "vts"],
}
// These tests are split out so that they can be conditioned on presence of the
@ -66,9 +69,12 @@ cc_test {
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
"android.hardware.wifi@1.0",
"libwifi-system-iface"
"libwifi-system-iface",
],
test_suites: [
"general-tests",
"vts",
],
test_suites: ["general-tests", "vts"],
}
// These tests are split out so that they can be conditioned on presence of
@ -83,7 +89,10 @@ cc_test {
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
"android.hardware.wifi@1.0",
"libwifi-system-iface"
"libwifi-system-iface",
],
test_suites: [
"general-tests",
"vts",
],
test_suites: ["general-tests", "vts"],
}

View file

@ -16,6 +16,7 @@
#include <android-base/logging.h>
#include <VtsCoreUtil.h>
#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/1.0/IWifiRttController.h>
#include <gtest/gtest.h>
@ -38,6 +39,8 @@ using ::android::hardware::wifi::V1_0::WifiStatusCode;
class WifiRttControllerHidlTest : public ::testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
if (!::testing::deviceSupportsFeature("android.hardware.wifi.rtt"))
GTEST_SKIP() << "Skipping this test since RTT is not supported.";
// Make sure test starts with a clean state
stopWifi(GetInstanceName());
}

View file

@ -18,14 +18,18 @@ cc_test {
name: "VtsHalWifiV1_1TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
"wifi_chip_hidl_test.cpp"],
"wifi_chip_hidl_test.cpp",
],
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
"android.hardware.wifi@1.0",
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"android.hardware.wifi@1.3",
"libwifi-system-iface"
"libwifi-system-iface",
],
test_suites: [
"general-tests",
"vts",
],
test_suites: ["general-tests", "vts"],
}

View file

@ -27,10 +27,13 @@ cc_test {
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"android.hardware.wifi@1.3",
"libwifi-system-iface"
"libwifi-system-iface",
],
disable_framework: true,
test_suites: ["general-tests", "vts"],
test_suites: [
"general-tests",
"vts",
],
}
cc_test {
@ -44,8 +47,10 @@ cc_test {
"android.hardware.wifi@1.0",
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"libwifi-system-iface"
"libwifi-system-iface",
],
test_suites: [
"general-tests",
"vts",
],
disable_framework: true,
test_suites: ["general-tests", "vts"],
}

View file

@ -16,6 +16,7 @@
#include <android-base/logging.h>
#include <VtsCoreUtil.h>
#include <android/hardware/wifi/1.2/IWifi.h>
#include <android/hardware/wifi/1.2/IWifiNanIface.h>
#include <android/hardware/wifi/1.2/IWifiNanIfaceEventCallback.h>
@ -50,6 +51,8 @@ android::sp<android::hardware::wifi::V1_2::IWifiNanIface> getWifiNanIface_1_2(
class WifiNanIfaceHidlTest : public ::testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware"))
GTEST_SKIP() << "Skipping this test since NAN is not supported.";
// Make sure to start with a clean state
stopWifi(GetInstanceName());

View file

@ -16,6 +16,7 @@
#include <android-base/logging.h>
#include <VtsCoreUtil.h>
#include <android/hardware/wifi/1.2/IWifiNanIfaceEventCallback.h>
#include <android/hardware/wifi/1.4/IWifi.h>
#include <android/hardware/wifi/1.4/IWifiNanIface.h>
@ -51,6 +52,8 @@ android::sp<android::hardware::wifi::V1_4::IWifiNanIface> getWifiNanIface_1_4(
class WifiNanIfaceHidlTest : public ::testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
if (!::testing::deviceSupportsFeature("android.hardware.wifi.aware"))
GTEST_SKIP() << "Skipping this test since NAN is not supported.";
// Make sure to start with a clean state
stopWifi(GetInstanceName());

View file

@ -19,6 +19,7 @@
#undef NAN // NAN is defined in bionic/libc/include/math.h:38
#include <VtsCoreUtil.h>
#include <android/hardware/wifi/1.3/IWifiStaIface.h>
#include <android/hardware/wifi/1.4/IWifi.h>
#include <android/hardware/wifi/1.4/IWifiChip.h>
@ -59,6 +60,8 @@ using ::android::hardware::wifi::V1_4::RttResult;
class WifiRttControllerHidlTest : public ::testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
if (!::testing::deviceSupportsFeature("android.hardware.wifi.rtt"))
GTEST_SKIP() << "Skipping this test since RTT is not supported.";
// Make sure to start with a clean state
stopWifi(GetInstanceName());