blob: 59ad2484699cb3b5fbd69c0b45f79688fe57e9d8 [file] [log] [blame]
Keigo Oka0ede7bd2019-05-13 17:35:13 +09001#
2# Copyright (C) 2019 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Amin Hassani165d4b42019-06-27 11:04:14 -070017# Stop linter from complaining XXX_unittest.cc naming.
18# gnlint: disable=GnLintSourceFileNames
19
Keigo Oka0ede7bd2019-05-13 17:35:13 +090020import("//common-mk/generate-dbus-adaptors.gni")
21import("//common-mk/generate-dbus-proxies.gni")
22import("//common-mk/openssl_pem.gni")
23import("//common-mk/pkg_config.gni")
24import("//common-mk/proto_library.gni")
25import("//update_engine/tar_bunzip2.gni")
26
27group("all") {
28 deps = [
29 ":delta_generator",
30 ":libpayload_consumer",
31 ":libpayload_generator",
32 ":libupdate_engine",
33 ":libupdate_engine_client",
34 ":update_engine",
35 ":update_engine-dbus-adaptor",
36 ":update_engine-dbus-kiosk-app-client",
37 ":update_engine_client",
38 ":update_metadata-protos",
39 ]
40
41 if (use.test) {
42 deps += [
43 ":test_http_server",
44 ":test_subprocess",
45 ":update_engine-test_images",
46 ":update_engine-testkeys",
47 ":update_engine_test_libs",
48 ":update_engine_unittests",
49 ]
50 }
51
52 if (use.fuzzer) {
Amin Hassani6f0366d2019-10-14 14:56:43 -070053 deps += [
54 ":update_engine_delta_performer_fuzzer",
55 ":update_engine_omaha_request_action_fuzzer",
56 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +090057 }
58}
59
60pkg_config("target_defaults") {
61 cflags_cc = [
62 "-fno-strict-aliasing",
63 "-Wnon-virtual-dtor",
64 ]
65 cflags = [
66 "-g",
67 "-ffunction-sections",
68 "-Wall",
69 "-Wextra",
70 "-Werror",
71 "-Wno-unused-parameter",
72 ]
73 ldflags = [ "-Wl,--gc-sections" ]
74 defines = [
75 "__CHROMEOS__",
76 "_FILE_OFFSET_BITS=64",
77 "_POSIX_C_SOURCE=199309L",
Matt Ziegelbaum7cfadf72020-06-09 18:51:16 -040078 "USE_CFM=${use.cfm}",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090079 "USE_DBUS=${use.dbus}",
80 "USE_FEC=0",
81 "USE_HWID_OVERRIDE=${use.hwid_override}",
82 "USE_CHROME_KIOSK_APP=${use.chrome_kiosk_app}",
83 "USE_CHROME_NETWORK_PROXY=${use.chrome_network_proxy}",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090084 "USE_SHILL=1",
85 ]
86 include_dirs = [
87 # We need this include dir because we include all the local code as
88 # "update_engine/...".
89 "${platform2_root}",
90 "${platform2_root}/update_engine/client_library/include",
91 ]
Clark Chunge6b888c2020-04-20 15:50:37 +080092
93 # NOSORT
Keigo Oka0ede7bd2019-05-13 17:35:13 +090094 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +090095 "libbrillo",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090096 "libchrome-${libbase_ver}",
97
98 # system_api depends on protobuf (or protobuf-lite). It must appear
99 # before protobuf here or the linker flags won't be in the right
100 # order.
101 "system_api",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900102 ]
Allen Webb816193f2019-10-25 10:06:46 -0700103 if (use.fuzzer) {
104 pkg_deps += [ "protobuf" ]
105 } else {
106 pkg_deps += [ "protobuf-lite" ]
107 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900108}
109
110# Protobufs.
111proto_library("update_metadata-protos") {
112 proto_in_dir = "."
113 proto_out_dir = "include/update_engine"
Clark Chunge6b888c2020-04-20 15:50:37 +0800114 sources = [ "update_metadata.proto" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900115}
116
117# Chrome D-Bus bindings.
118generate_dbus_adaptors("update_engine-dbus-adaptor") {
119 dbus_adaptors_out_dir = "include/dbus_bindings"
Clark Chunge6b888c2020-04-20 15:50:37 +0800120 sources = [ "dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900121}
122
123generate_dbus_proxies("update_engine-dbus-kiosk-app-client") {
124 mock_output_file = "include/kiosk-app/dbus-proxy-mocks.h"
125 proxy_output_file = "include/kiosk-app/dbus-proxies.h"
Clark Chunge6b888c2020-04-20 15:50:37 +0800126 sources = [ "dbus_bindings/org.chromium.KioskAppService.dbus-xml" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900127}
128
129# The payload application component and common dependencies.
130static_library("libpayload_consumer") {
131 sources = [
132 "common/action_processor.cc",
133 "common/boot_control_stub.cc",
134 "common/clock.cc",
135 "common/constants.cc",
136 "common/cpu_limiter.cc",
137 "common/error_code_utils.cc",
138 "common/hash_calculator.cc",
139 "common/http_common.cc",
140 "common/http_fetcher.cc",
141 "common/hwid_override.cc",
142 "common/multi_range_http_fetcher.cc",
143 "common/platform_constants_chromeos.cc",
144 "common/prefs.cc",
145 "common/proxy_resolver.cc",
146 "common/subprocess.cc",
147 "common/terminator.cc",
148 "common/utils.cc",
149 "payload_consumer/bzip_extent_writer.cc",
150 "payload_consumer/cached_file_descriptor.cc",
151 "payload_consumer/delta_performer.cc",
152 "payload_consumer/download_action.cc",
153 "payload_consumer/extent_reader.cc",
154 "payload_consumer/extent_writer.cc",
155 "payload_consumer/file_descriptor.cc",
156 "payload_consumer/file_descriptor_utils.cc",
157 "payload_consumer/file_writer.cc",
158 "payload_consumer/filesystem_verifier_action.cc",
159 "payload_consumer/install_plan.cc",
160 "payload_consumer/mount_history.cc",
161 "payload_consumer/payload_constants.cc",
162 "payload_consumer/payload_metadata.cc",
163 "payload_consumer/payload_verifier.cc",
164 "payload_consumer/postinstall_runner_action.cc",
165 "payload_consumer/verity_writer_stub.cc",
166 "payload_consumer/xz_extent_writer.cc",
167 ]
168 configs += [ ":target_defaults" ]
169 libs = [
170 "bz2",
171 "rt",
172 ]
173
Allen Webb975e8662020-05-14 14:33:13 -0700174 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
175 # declarations.
176 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
177
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900178 # TODO(deymo): Remove unused dependencies once we stop including files
179 # from the root directory.
180 all_dependent_pkg_deps = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900181 "libbspatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800182 "libcrypto",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900183 "libpuffpatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800184 "xz-embedded",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900185 ]
Tatsuhisa Yamaguchi74e47d92020-05-27 05:32:16 +0000186 public_deps = [ ":update_metadata-protos" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900187}
188
189# The main daemon static_library with all the code used to check for updates
190# with Omaha and expose a DBus daemon.
191static_library("libupdate_engine") {
192 sources = [
193 "boot_control_chromeos.cc",
194 "certificate_checker.cc",
195 "common_service.cc",
196 "connection_manager.cc",
197 "connection_utils.cc",
Amin Hassani565331e2019-06-24 14:11:29 -0700198 "daemon_chromeos.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900199 "dbus_connection.cc",
200 "dbus_service.cc",
201 "hardware_chromeos.cc",
202 "image_properties_chromeos.cc",
203 "libcurl_http_fetcher.cc",
204 "metrics_reporter_omaha.cc",
205 "metrics_utils.cc",
206 "omaha_request_action.cc",
207 "omaha_request_builder_xml.cc",
208 "omaha_request_params.cc",
209 "omaha_response_handler_action.cc",
210 "omaha_utils.cc",
211 "p2p_manager.cc",
212 "payload_state.cc",
213 "power_manager_chromeos.cc",
214 "real_system_state.cc",
Matt Ziegelbaum91ba9be2020-06-10 16:56:40 -0400215 "requisition_util.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900216 "shill_proxy.cc",
217 "update_attempter.cc",
218 "update_boot_flags_action.cc",
219 "update_manager/boxed_value.cc",
220 "update_manager/chromeos_policy.cc",
221 "update_manager/default_policy.cc",
222 "update_manager/enough_slots_ab_updates_policy_impl.cc",
223 "update_manager/enterprise_device_policy_impl.cc",
224 "update_manager/evaluation_context.cc",
225 "update_manager/interactive_update_policy_impl.cc",
226 "update_manager/next_update_check_policy_impl.cc",
227 "update_manager/official_build_check_policy_impl.cc",
228 "update_manager/out_of_box_experience_policy_impl.cc",
229 "update_manager/policy.cc",
230 "update_manager/policy_test_utils.cc",
231 "update_manager/real_config_provider.cc",
232 "update_manager/real_device_policy_provider.cc",
233 "update_manager/real_random_provider.cc",
234 "update_manager/real_shill_provider.cc",
235 "update_manager/real_system_provider.cc",
236 "update_manager/real_time_provider.cc",
237 "update_manager/real_updater_provider.cc",
238 "update_manager/staging_utils.cc",
239 "update_manager/state_factory.cc",
240 "update_manager/update_manager.cc",
241 "update_manager/update_time_restrictions_policy_impl.cc",
242 "update_manager/weekly_time.cc",
243 "update_status_utils.cc",
244 ]
245 configs += [ ":target_defaults" ]
246 libs = [
247 "bz2",
Grace Chamb6d1b412019-10-31 14:53:42 +0900248 "policy",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900249 "rootdev",
250 "rt",
251 ]
252 all_dependent_pkg_deps = [
253 "dbus-1",
254 "expat",
255 "libcurl",
256 "libdebugd-client",
Qijiang Fanb9c82102020-08-28 16:06:33 +0900257 "libmetrics",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900258 "libpower_manager-client",
259 "libsession_manager-client",
260 "libshill-client",
261 "libssl",
262 "libupdate_engine-client",
263 "vboot_host",
264 ]
265 deps = [
266 ":libpayload_consumer",
267 ":update_engine-dbus-adaptor",
268 ":update_metadata-protos",
269 ]
270
271 if (use.dlc) {
272 all_dependent_pkg_deps += [ "libdlcservice-client" ]
273 }
274
275 if (use.chrome_network_proxy) {
276 sources += [ "chrome_browser_proxy_resolver.cc" ]
277 }
278
279 if (use.chrome_kiosk_app) {
280 deps += [ ":update_engine-dbus-kiosk-app-client" ]
281 }
282
283 if (use.dlc) {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700284 sources += [
285 "dlcservice_chromeos.cc",
286 "excluder_chromeos.cc",
287 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900288 } else {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700289 sources += [
290 "common/dlcservice_stub.cc",
291 "common/excluder_stub.cc",
292 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900293 }
294}
295
296# update_engine daemon.
297executable("update_engine") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800298 sources = [ "main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900299 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800300 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900301}
302
303# update_engine client library.
304static_library("libupdate_engine_client") {
305 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900306 "client_library/client_dbus.cc",
307 "update_status_utils.cc",
308 ]
309 include_dirs = [ "client_library/include" ]
310 configs += [ ":target_defaults" ]
311 pkg_deps = [
312 "dbus-1",
313 "libupdate_engine-client",
314 ]
315}
316
317# update_engine console client.
318executable("update_engine_client") {
319 sources = [
320 "common/error_code_utils.cc",
321 "omaha_utils.cc",
322 "update_engine_client.cc",
323 ]
324 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800325 deps = [ ":libupdate_engine_client" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900326}
327
328# server-side code. This is used for delta_generator and unittests but not
329# for any client code.
330static_library("libpayload_generator") {
331 sources = [
332 "common/file_fetcher.cc",
333 "payload_generator/ab_generator.cc",
334 "payload_generator/annotated_operation.cc",
335 "payload_generator/blob_file_writer.cc",
336 "payload_generator/block_mapping.cc",
337 "payload_generator/boot_img_filesystem.cc",
338 "payload_generator/bzip.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900339 "payload_generator/deflate_utils.cc",
340 "payload_generator/delta_diff_generator.cc",
341 "payload_generator/delta_diff_utils.cc",
342 "payload_generator/ext2_filesystem.cc",
343 "payload_generator/extent_ranges.cc",
344 "payload_generator/extent_utils.cc",
345 "payload_generator/full_update_generator.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900346 "payload_generator/mapfile_filesystem.cc",
347 "payload_generator/payload_file.cc",
348 "payload_generator/payload_generation_config.cc",
349 "payload_generator/payload_generation_config_chromeos.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700350 "payload_generator/payload_properties.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900351 "payload_generator/payload_signer.cc",
352 "payload_generator/raw_filesystem.cc",
353 "payload_generator/squashfs_filesystem.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900354 "payload_generator/xz_chromeos.cc",
355 ]
356 configs += [ ":target_defaults" ]
357 all_dependent_pkg_deps = [
358 "ext2fs",
359 "libbsdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900360 "liblzma",
Clark Chunge6b888c2020-04-20 15:50:37 +0800361 "libpuffdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900362 ]
363 deps = [
364 ":libpayload_consumer",
365 ":update_metadata-protos",
366 ]
Allen Webb975e8662020-05-14 14:33:13 -0700367
368 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
369 # declarations.
370 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900371}
372
373# server-side delta generator.
374executable("delta_generator") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800375 sources = [ "payload_generator/generate_delta_main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900376 configs += [ ":target_defaults" ]
377 configs -= [ "//common-mk:pie" ]
378 deps = [
379 ":libpayload_consumer",
380 ":libpayload_generator",
381 ]
382}
383
384if (use.test || use.fuzzer) {
385 static_library("update_engine_test_libs") {
386 sources = [
387 "common/fake_prefs.cc",
388 "common/mock_http_fetcher.cc",
389 "common/test_utils.cc",
390 "fake_shill_proxy.cc",
391 "fake_system_state.cc",
392 "payload_consumer/fake_file_descriptor.cc",
393 "payload_generator/fake_filesystem.cc",
394 "update_manager/umtest_utils.cc",
395 ]
Keigo Okaec39a222019-06-27 13:51:07 +0900396
397 # TODO(crbug.com/887845): After library odering issue is fixed,
398 # //common-mk:test can be moved in all_dependent_configs and
399 # //common-mk:test in each test configs can be removed.
400 configs += [
401 "//common-mk:test",
402 ":target_defaults",
403 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900404 pkg_deps = [ "libshill-client-test" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800405 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900406 }
407}
408
409if (use.test) {
410 # Public keys used for unit testing.
411 genopenssl_key("update_engine-testkeys") {
412 openssl_pem_in_dir = "."
413 openssl_pem_out_dir = "include/update_engine"
414 sources = [
415 "unittest_key.pem",
416 "unittest_key2.pem",
417 ]
418 }
419
420 # Unpacks sample images used for testing.
421 tar_bunzip2("update_engine-test_images") {
422 image_out_dir = "."
Clark Chunge6b888c2020-04-20 15:50:37 +0800423 sources = [ "sample_images/sample_images.tar.bz2" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900424 }
425
426 # Test HTTP Server.
427 executable("test_http_server") {
428 sources = [
429 "common/http_common.cc",
430 "test_http_server.cc",
431 ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700432
Keigo Okaec39a222019-06-27 13:51:07 +0900433 # //common-mk:test should be on the top.
434 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
435 configs += [
436 "//common-mk:test",
437 ":target_defaults",
438 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900439 }
440
441 # Test subprocess helper.
442 executable("test_subprocess") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800443 sources = [ "test_subprocess.cc" ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700444
Keigo Okaec39a222019-06-27 13:51:07 +0900445 # //common-mk:test should be on the top.
446 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
447 configs += [
448 "//common-mk:test",
449 ":target_defaults",
450 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900451 }
452
453 # Main unittest file.
454 executable("update_engine_unittests") {
455 sources = [
456 "boot_control_chromeos_unittest.cc",
457 "certificate_checker_unittest.cc",
458 "common/action_pipe_unittest.cc",
459 "common/action_processor_unittest.cc",
460 "common/action_unittest.cc",
461 "common/cpu_limiter_unittest.cc",
462 "common/hash_calculator_unittest.cc",
463 "common/http_fetcher_unittest.cc",
464 "common/hwid_override_unittest.cc",
465 "common/prefs_unittest.cc",
466 "common/proxy_resolver_unittest.cc",
467 "common/subprocess_unittest.cc",
468 "common/terminator_unittest.cc",
469 "common/utils_unittest.cc",
470 "common_service_unittest.cc",
471 "connection_manager_unittest.cc",
472 "hardware_chromeos_unittest.cc",
473 "image_properties_chromeos_unittest.cc",
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700474 "libcurl_http_fetcher_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900475 "metrics_reporter_omaha_unittest.cc",
476 "metrics_utils_unittest.cc",
477 "omaha_request_action_unittest.cc",
478 "omaha_request_builder_xml_unittest.cc",
479 "omaha_request_params_unittest.cc",
480 "omaha_response_handler_action_unittest.cc",
481 "omaha_utils_unittest.cc",
482 "p2p_manager_unittest.cc",
483 "payload_consumer/bzip_extent_writer_unittest.cc",
484 "payload_consumer/cached_file_descriptor_unittest.cc",
485 "payload_consumer/delta_performer_integration_test.cc",
486 "payload_consumer/delta_performer_unittest.cc",
487 "payload_consumer/download_action_unittest.cc",
488 "payload_consumer/extent_reader_unittest.cc",
489 "payload_consumer/extent_writer_unittest.cc",
490 "payload_consumer/file_descriptor_utils_unittest.cc",
491 "payload_consumer/file_writer_unittest.cc",
492 "payload_consumer/filesystem_verifier_action_unittest.cc",
493 "payload_consumer/postinstall_runner_action_unittest.cc",
494 "payload_consumer/xz_extent_writer_unittest.cc",
495 "payload_generator/ab_generator_unittest.cc",
496 "payload_generator/blob_file_writer_unittest.cc",
497 "payload_generator/block_mapping_unittest.cc",
498 "payload_generator/boot_img_filesystem_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900499 "payload_generator/deflate_utils_unittest.cc",
500 "payload_generator/delta_diff_utils_unittest.cc",
501 "payload_generator/ext2_filesystem_unittest.cc",
502 "payload_generator/extent_ranges_unittest.cc",
503 "payload_generator/extent_utils_unittest.cc",
504 "payload_generator/full_update_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900505 "payload_generator/mapfile_filesystem_unittest.cc",
506 "payload_generator/payload_file_unittest.cc",
507 "payload_generator/payload_generation_config_unittest.cc",
Jae Hoon Kim4b6d1262019-06-20 10:41:18 -0700508 "payload_generator/payload_properties_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900509 "payload_generator/payload_signer_unittest.cc",
510 "payload_generator/squashfs_filesystem_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900511 "payload_generator/zip_unittest.cc",
512 "payload_state_unittest.cc",
Matt Ziegelbaum91ba9be2020-06-10 16:56:40 -0400513 "requisition_util_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900514 "testrunner.cc",
515 "update_attempter_unittest.cc",
516 "update_boot_flags_action_unittest.cc",
517 "update_manager/boxed_value_unittest.cc",
518 "update_manager/chromeos_policy_unittest.cc",
519 "update_manager/evaluation_context_unittest.cc",
520 "update_manager/generic_variables_unittest.cc",
521 "update_manager/prng_unittest.cc",
522 "update_manager/real_device_policy_provider_unittest.cc",
523 "update_manager/real_random_provider_unittest.cc",
524 "update_manager/real_shill_provider_unittest.cc",
525 "update_manager/real_system_provider_unittest.cc",
526 "update_manager/real_time_provider_unittest.cc",
527 "update_manager/real_updater_provider_unittest.cc",
528 "update_manager/staging_utils_unittest.cc",
529 "update_manager/update_manager_unittest.cc",
530 "update_manager/update_time_restrictions_policy_impl_unittest.cc",
531 "update_manager/variable_unittest.cc",
532 "update_manager/weekly_time_unittest.cc",
Jae Hoon Kim916af852019-08-01 17:45:30 -0700533 "update_status_utils_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900534 ]
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700535 if (use.dlc) {
536 sources += [ "excluder_chromeos_unittest.cc" ]
537 }
Brian Norris0ffa71f2019-07-08 10:25:54 -0700538
Keigo Okaec39a222019-06-27 13:51:07 +0900539 # //common-mk:test should be on the top.
540 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
541 configs += [
542 "//common-mk:test",
543 ":target_defaults",
544 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900545 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900546 "libbrillo-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900547 "libchrome-test-${libbase_ver}",
548 "libdebugd-client-test",
549 "libpower_manager-client-test",
550 "libsession_manager-client-test",
551 "libshill-client-test",
552 ]
553 deps = [
554 ":libpayload_generator",
555 ":libupdate_engine",
556 ":update_engine_test_libs",
557 ]
558 }
559}
560
561# Fuzzer target.
562if (use.fuzzer) {
Amin Hassani6f0366d2019-10-14 14:56:43 -0700563 executable("update_engine_delta_performer_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800564 sources = [ "payload_consumer/delta_performer_fuzzer.cc" ]
Amin Hassani6f0366d2019-10-14 14:56:43 -0700565 configs += [
566 "//common-mk/common_fuzzer",
567 ":target_defaults",
568 ]
569 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900570 "libbrillo-test",
Amin Hassani6f0366d2019-10-14 14:56:43 -0700571 "libchrome-test-${libbase_ver}",
572 ]
573 deps = [
574 ":libupdate_engine",
575 ":update_engine_test_libs",
576 ]
577 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900578 executable("update_engine_omaha_request_action_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800579 sources = [ "omaha_request_action_fuzzer.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900580 configs += [
581 "//common-mk/common_fuzzer",
582 ":target_defaults",
583 ]
584 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900585 "libbrillo-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900586 "libchrome-test-${libbase_ver}",
587 ]
588 deps = [
589 ":libupdate_engine",
590 ":update_engine_test_libs",
591 ]
592 }
593}