Restore the usage of WIFI-specific main function. The main
function was inadvertantly disabled by moving it into a static
library - which caused the default main to be used.
Need a custom main since need to stop WIFI before tests start
to enforce a clean starting point.
Bug:
35276551
Test: confirms custom main routine is called
Change-Id: I978827bc0f0f16d9ca4f159fbf42d0bc53f5df99
cc_library_static {
name: "VtsHalWifiV1_0TargetTestUtil",
srcs: [
- "VtsHalWifiV1_0TargetTest.cpp",
+
"wifi_hidl_call_util_selftest.cpp",
"wifi_hidl_test.cpp",
"wifi_hidl_test_utils.cpp"],
name: "VtsHalWifiV1_0TargetTest",
defaults: ["hidl_defaults"],
srcs: [
+ "VtsHalWifiV1_0TargetTest.cpp",
"wifi_ap_iface_hidl_test.cpp",
"wifi_chip_hidl_test.cpp",
"wifi_p2p_iface_hidl_test.cpp",
cc_test {
name: "VtsHalWifiNanV1_0TargetTest",
defaults: ["hidl_defaults"],
- srcs: ["wifi_nan_iface_hidl_test.cpp"],
+ srcs: [
+ "VtsHalWifiV1_0TargetTest.cpp",
+ "wifi_nan_iface_hidl_test.cpp"],
shared_libs: [
"libbase",
"liblog",
#include "wifi_hidl_test_utils.h"
-class WifiHidlEnvironment : public ::testing::Environment {
- public:
- virtual void SetUp() override { stopFramework(); }
- virtual void TearDown() override { startFramework(); }
-
- private:
-};
-
int main(int argc, char** argv) {
::testing::AddGlobalTestEnvironment(new WifiHidlEnvironment);
::testing::InitGoogleTest(&argc, argv);
}
} // namespace
-void stopFramework() {
- ASSERT_EQ(std::system("stop"), 0);
- stopWifi();
- sleep(5);
-}
-
-void startFramework() { ASSERT_EQ(std::system("start"), 0); }
-
sp<IWifi> getWifi() {
sp<IWifi> wifi = ::testing::VtsHalHidlTargetTestBase::getService<IWifi>();
return wifi;
#include <android/hardware/wifi/1.0/IWifiRttController.h>
#include <android/hardware/wifi/1.0/IWifiStaIface.h>
-// Used to stop the android framework (wifi service) before every
-// test.
-void stopFramework();
-void startFramework();
-
// Helper functions to obtain references to the various HIDL interface objects.
// Note: We only have a single instance of each of these objects currently.
// These helper functions should be modified to return vectors if we support
android::hardware::wifi::V1_0::ChipModeId* configured_mode_id);
// Used to trigger IWifi.stop() at the end of every test.
void stopWifi();
+
+class WifiHidlEnvironment : public ::testing::Environment {
+ public:
+ virtual void SetUp() override {
+ stopWifi();
+ sleep(5);
+ }
+ virtual void TearDown() override {}
+};
\ No newline at end of file