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

Commit ebb9c823 authored by Myles Watson's avatar Myles Watson
Browse files

GD: Split tests into module vs unit tests

Move simpler, single-threaded tests into their own set of unit tests.

Bug: 176832968
Test: atest bluetooth_test_gd_unit
Tag: #gd-refactor
Change-Id: Ic3fa06454d119764aa547f975843583c00c32fc4
parent 5f2fc457
Loading
Loading
Loading
Loading
+81 −1
Original line number Diff line number Diff line
@@ -279,6 +279,87 @@ cc_binary {
    }
}

cc_test {
    name: "bluetooth_test_gd_unit",
    test_suites: ["device-tests"],
    defaults: [
        "gd_defaults",
        "gd_clang_coverage_bin",
    ],
    host_supported: true,
    test_options: {
        unit_test: true,
    },
    target: {
        linux: {
            srcs: [
                ":BluetoothOsTestSources_linux_generic",
            ],
        },
        host: {
            srcs: [
                ":BluetoothHalTestSources_hci_host",
                ":BluetoothOsTestSources_host",
            ],
        },
        android: {
            srcs: [
                ":BluetoothHalTestSources_hci_android_hidl",
                ":BluetoothOsTestSources_android",
            ],
            shared_libs: [
                "android.hardware.bluetooth@1.0",
                "android.hardware.bluetooth@1.1",
                "android.system.suspend.control-V1-ndk",
                "libbinder_ndk",
                "libhidlbase",
                "libutils",
                "libcutils",
                "libstatslog",
            ],
        },
    },
    srcs: [
        "module_unittest.cc",
        "stack_manager_unittest.cc",
        ":BluetoothCommonTestSources",
        ":BluetoothCryptoToolboxTestSources",
        ":BluetoothDumpsysTestSources",
        ":BluetoothHalTestSources",
        ":BluetoothHciUnitTestSources",
        ":BluetoothL2capUnitTestSources",
        ":BluetoothPacketTestSources",
        ":BluetoothShimTestSources",
        ":BluetoothSecurityUnitTestSources",
        ":BluetoothStorageUnitTestSources",
    ],
    generated_headers: [
        "BluetoothGeneratedBundlerSchema_h_bfbs",
        "BluetoothGeneratedDumpsysBundledSchema_h",
        "BluetoothGeneratedDumpsysBundledTestSchema_h",
        "BluetoothGeneratedDumpsysDataSchema_h",
        "BluetoothGeneratedDumpsysTestData_h",
        "BluetoothGeneratedPackets_h",
    ],
    static_libs: [
        "libbluetooth-protos",
        "libbluetooth_gd",
        "libc++fs",
        "libflatbuffers-cpp",
        "libgmock",
        "libbluetooth_rust_interop",
    ],
    shared_libs: [
        "libchrome",
        "libcrypto",
        "libgrpc++",
        "libgrpc_wrap",
    ],
    sanitize: {
        address: true,
    },
}

cc_test {
    name: "bluetooth_test_gd",
    test_suites: ["device-tests"],
@@ -333,7 +414,6 @@ cc_test {
        ":BluetoothNeighborTestSources",
        ":BluetoothPacketTestSources",
        ":BluetoothSecurityTestSources",
        ":BluetoothShimTestSources",
        ":BluetoothStorageTestSources",
    ],
    generated_headers: [
+11 −5
Original line number Diff line number Diff line
@@ -30,21 +30,27 @@ filegroup {
}

filegroup {
    name: "BluetoothHciTestSources",
    name: "BluetoothHciUnitTestSources",
    srcs: [
        "acl_builder_test.cc",
        "acl_manager/round_robin_scheduler_test.cc",
        "acl_manager_test.cc",
        "address_unittest.cc",
        "address_with_type_test.cc",
        "class_of_device_unittest.cc",
        "hci_packets_test.cc",
        "uuid_unittest.cc",
    ],
}

filegroup {
    name: "BluetoothHciTestSources",
    srcs: [
        "acl_manager/round_robin_scheduler_test.cc",
        "acl_manager_test.cc",
        "controller_test.cc",
        "hci_layer_test.cc",
        "hci_packets_test.cc",
        "le_address_manager_test.cc",
        "le_advertising_manager_test.cc",
        "le_scanning_manager_test.cc",
        "uuid_unittest.cc",
    ],
}

+7 −1
Original line number Diff line number Diff line
@@ -69,11 +69,17 @@ filegroup {
        "internal/receiver_test.cc",
        "internal/scheduler_fifo_test.cc",
        "internal/sender_test.cc",
        "l2cap_packet_test.cc",
        "le/internal/dynamic_channel_service_manager_test.cc",
        "le/internal/fixed_channel_impl_test.cc",
        "le/internal/fixed_channel_service_manager_test.cc",
        "le/internal/link_manager_test.cc",
    ],
}

filegroup {
    name: "BluetoothL2capUnitTestSources",
    srcs: [
        "l2cap_packet_test.cc",
        "signal_id_test.cc",
    ],
}
+8 −2
Original line number Diff line number Diff line
@@ -28,11 +28,17 @@ filegroup {
}

filegroup {
    name: "BluetoothSecurityTestSources",
    name: "BluetoothSecurityUnitTestSources",
    srcs: [
        "ecc/multipoint_test.cc",
        "pairing_handler_le_unittest.cc",
        "test/ecdh_keys_test.cc",
    ],
}

filegroup {
    name: "BluetoothSecurityTestSources",
    srcs: [
        "pairing_handler_le_unittest.cc",
        "test/fake_l2cap_test.cc",
        "test/pairing_handler_le_pair_test.cc",
        ":BluetoothSecurityChannelTestSources",
+7 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ filegroup {
}

filegroup {
    name: "BluetoothStorageTestSources",
    name: "BluetoothStorageUnitTestSources",
    srcs: [
            "adapter_config_test.cc",
            "classic_device_test.cc",
@@ -34,6 +34,12 @@ filegroup {
            "le_device_test.cc",
            "legacy_config_file_test.cc",
            "mutation_test.cc",
    ],
}

filegroup {
    name: "BluetoothStorageTestSources",
    srcs: [
            "storage_module_test.cc",
    ],
}