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
15
16cc_test_host {
17    name: "recovery_host_test",
18    isolated: true,
19
20    include_dirs: [
21        "bootable/deprecated-ota",
22        "bootable/recovery/tests",
23    ],
24
25    defaults: [
26        "recovery_test_defaults",
27        "libupdater_defaults",
28    ],
29
30    tidy_timeout_srcs: [
31        "unit/host/imgdiff_test.cpp",
32    ],
33
34    srcs: [
35        "unit/host/*",
36    ],
37
38    static_libs: [
39        "libupdater_host",
40        "libupdater_core",
41        "libimgdiff",
42        "libbsdiff",
43        "libdivsufsort64",
44        "libdivsufsort",
45        "libfstab",
46    ],
47
48    test_suites: ["general-tests"],
49    test_config: "RecoveryHostTest.xml",
50
51    data: ["testdata/*"],
52
53    target: {
54        darwin: {
55            // libapplypatch in "libupdater_defaults" is not available on the Mac.
56            enabled: false,
57        },
58    },
59}
60
61// libapplypatch, libapplypatch_modes
62libapplypatch_static_libs = [
63    "libapplypatch_modes",
64    "libapplypatch",
65    "libedify",
66    "libotautil",
67    "libbsdiff",
68    "libbspatch",
69    "libdivsufsort",
70    "libdivsufsort64",
71    "libutils",
72    "libbase",
73    "libbrotli",
74    "libbz",
75    "libz_stable",
76    "libziparchive",
77]
78
79cc_test {
80    name: "non_ab_unit_tests",
81    isolated: true,
82    require_root: true,
83    include_dirs: [
84        "bootable/deprecated-ota",
85        "bootable/recovery/tests",
86    ],
87
88    defaults: [
89        "recovery_test_defaults",
90        "libupdater_defaults",
91        "libupdater_device_defaults",
92    ],
93
94    test_suites: ["device-tests"],
95
96    tidy_timeout_srcs: [
97        "unit/commands_test.cpp",
98    ],
99
100    srcs: [
101        "unit/*.cpp",
102    ],
103
104    shared_libs: [
105        "libbinder_ndk",
106    ],
107
108    static_libs: libapplypatch_static_libs + [
109        "android.hardware.health-translate-ndk",
110        "android.hardware.health-V3-ndk",
111        "libhealthshim",
112        "librecovery_ui",
113        "libfusesideload",
114        "libminui",
115        "librecovery_utils",
116        "libotautil",
117        "libupdater_device",
118        "libupdater_core",
119        "libupdate_verifier",
120
121        "libprotobuf-cpp-lite",
122    ],
123    header_libs: [
124        "libgtest_prod_headers",
125    ],
126
127    data: [
128        "testdata/*",
129        ":recovery_image",
130        ":res-testdata",
131    ],
132}
133