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

Commit 9532a51c authored by Siarhei Vishniakou's avatar Siarhei Vishniakou Committed by Android (Google) Code Review
Browse files

Merge "Run libinput_tests on host"

parents 0c21a964 5e83dfec
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ cc_library {
            shared_libs: [
                "libutils",
                "libbinder",
                "libui",
            ],

            static_libs: [
+5 −2
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ package {

cc_test {
    name: "libinput_tests",
    host_supported: true,
    srcs: [
        "IdGenerator_test.cpp",
        "InputChannel_test.cpp",
@@ -24,6 +25,7 @@ cc_test {
    static_libs: [
        "libgui_window_info_static",
        "libinput",
        "libui-types",
    ],
    cflags: [
        "-Wall",
@@ -35,11 +37,13 @@ cc_test {
        "libbinder",
        "libcutils",
        "liblog",
        "libui",
        "libutils",
        "libvintf",
    ],
    data: ["data/*"],
    test_options: {
        unit_test: true,
    },
    test_suites: ["device-tests"],
}

@@ -60,7 +64,6 @@ cc_library_static {
        "libcutils",
        "libutils",
        "libbinder",
        "libui",
        "libbase",
    ],
}
+9 −0
Original line number Diff line number Diff line
@@ -65,6 +65,9 @@ protected:
    }

    void SetUp() override {
#if !defined(__ANDROID__)
        GTEST_SKIP() << "b/253299089 Generic files are currently read directly from device.";
#endif
        loadKeyLayout("Generic");
        loadKeyCharacterMap("Generic");
    }
@@ -131,6 +134,9 @@ TEST_F(InputDeviceKeyMapTest, keyCharacteMapApplyMultipleOverlaysTest) {
}

TEST(InputDeviceKeyLayoutTest, DoesNotLoadWhenRequiredKernelConfigIsMissing) {
#if !defined(__ANDROID__)
    GTEST_SKIP() << "Can't check kernel configs on host";
#endif
    std::string klPath = base::GetExecutableDirectory() + "/data/kl_with_required_fake_config.kl";
    base::Result<std::shared_ptr<KeyLayoutMap>> ret = KeyLayoutMap::load(klPath);
    ASSERT_FALSE(ret.ok()) << "Should not be able to load KeyLayout at " << klPath;
@@ -139,6 +145,9 @@ TEST(InputDeviceKeyLayoutTest, DoesNotLoadWhenRequiredKernelConfigIsMissing) {
}

TEST(InputDeviceKeyLayoutTest, LoadsWhenRequiredKernelConfigIsPresent) {
#if !defined(__ANDROID__)
    GTEST_SKIP() << "Can't check kernel configs on host";
#endif
    std::string klPath = base::GetExecutableDirectory() + "/data/kl_with_required_real_config.kl";
    base::Result<std::shared_ptr<KeyLayoutMap>> ret = KeyLayoutMap::load(klPath);
    ASSERT_TRUE(ret.ok()) << "Cannot load KeyLayout at " << klPath;