xref: /aosp_15_r20/bootable/deprecated-ota/tests/Android.bp (revision acea8879c968027b49a027136800575dd9783ddf)
1// Copyright (C) 2024 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15cc_test_host {
16    name: "recovery_host_test",
17    isolated: true,
18
19    include_dirs: [
20        "bootable/deprecated-ota",
21        "bootable/recovery/tests",
22    ],
23
24    defaults: [
25        "recovery_test_defaults",
26        "libupdater_defaults",
27    ],
28
29    tidy_timeout_srcs: [
30        "unit/host/imgdiff_test.cpp",
31    ],
32
33    srcs: [
34        "unit/host/*",
35    ],
36
37    static_libs: [
38        "libupdater_host",
39        "libupdater_core",
40        "libimgdiff",
41        "libbsdiff",
42        "libdivsufsort64",
43        "libdivsufsort",
44        "libfstab",
45    ],
46
47    test_suites: ["general-tests"],
48    test_config: "RecoveryHostTest.xml",
49
50    data: ["testdata/*"],
51
52    target: {
53        darwin: {
54            // libapplypatch in "libupdater_defaults" is not available on the Mac.
55            enabled: false,
56        },
57    },
58}
59
60// libapplypatch, libapplypatch_modes
61libapplypatch_static_libs = [
62    "libapplypatch_modes",
63    "libapplypatch",
64    "libedify",
65    "libotautil",
66    "libbsdiff",
67    "libbspatch",
68    "libdivsufsort",
69    "libdivsufsort64",
70    "libutils",
71    "libbase",
72    "libbrotli",
73    "libbz",
74    "libz_stable",
75    "libziparchive",
76]
77
78cc_test {
79    name: "non_ab_unit_tests",
80    isolated: true,
81    require_root: true,
82    include_dirs: [
83        "bootable/deprecated-ota",
84        "bootable/recovery/tests",
85    ],
86
87    defaults: [
88        "recovery_test_defaults",
89        "libupdater_defaults",
90        "libupdater_device_defaults",
91    ],
92
93    test_suites: ["device-tests"],
94
95    tidy_timeout_srcs: [
96        "unit/commands_test.cpp",
97    ],
98
99    srcs: [
100        "unit/*.cpp",
101    ],
102
103    shared_libs: [
104        "libbinder_ndk",
105    ],
106
107    static_libs: libapplypatch_static_libs + [
108        "android.hardware.health-translate-ndk",
109        "android.hardware.health-V4-ndk",
110        "libhealthshim",
111        "librecovery_ui",
112        "libfusesideload",
113        "libminui",
114        "librecovery_utils",
115        "libotautil",
116        "libupdater_device",
117        "libupdater_core",
118        "libupdate_verifier",
119
120        "libprotobuf-cpp-lite",
121    ],
122    header_libs: [
123        "libgtest_prod_headers",
124    ],
125
126    data: [
127        "testdata/*",
128        ":recovery_image",
129        ":res-testdata",
130    ],
131}
132