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

Commit 01705e4f authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Clean up libcutils/libutils tests.

Move tests in the same directory as the corresponding code, so it's
easier to see what is/isn't tested.

Fix naming of libcutils_tests (plural) to match the singular that's more
common (even though the plural makes more sense to me).

Add these two to system/core/'s TEST_MAPPING.

Remove obsolete AndroidTest.xml.

Fix a flaky (timing-dependent) libcutils test.

Test: ran tests
Change-Id: I7e0a31ff45c8a152562bf66fc97161594249366e
parent ea57928f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@
    {
      "name": "libprocinfo_test"
    },
    {
      "name": "libutils_test"
    },
    {
      "name": "memunreachable_test"
    },
+68 −1
Original line number Diff line number Diff line
@@ -196,4 +196,71 @@ cc_library {
    ],
}

subdirs = ["tests"]
cc_defaults {
    name: "libcutils_test_default",
    srcs: ["sockets_test.cpp"],

    target: {
        android: {
            srcs: [
                "android_get_control_file_test.cpp",
                "android_get_control_socket_test.cpp",
                "ashmem_test.cpp",
                "fs_config_test.cpp",
                "memset_test.cpp",
                "multiuser_test.cpp",
                "properties_test.cpp",
                "sched_policy_test.cpp",
                "str_parms_test.cpp",
                "trace-dev_test.cpp",
            ],
        },

        not_windows: {
            srcs: [
                "str_parms_test.cpp",
            ],
        },
    },

    cflags: [
        "-Wall",
        "-Wextra",
        "-Werror",
    ],
}

test_libraries = [
    "libcutils",
    "liblog",
    "libbase",
    "libjsoncpp",
    "libprocessgroup",
]

cc_test {
    name: "libcutils_test",
    test_suites: ["device-tests"],
    defaults: ["libcutils_test_default"],
    host_supported: true,
    shared_libs: test_libraries,
}

cc_test {
    name: "libcutils_test_static",
    test_suites: ["device-tests"],
    defaults: ["libcutils_test_default"],
    static_libs: ["libc"] + test_libraries,
    stl: "libc++_static",

    target: {
        android: {
            static_executable: true,
        },
        windows: {
            host_ldlibs: ["-lws2_32"],

            enabled: true,
        },
    },
}
Loading