blob: 9575fab7a91ae0fba891751e542f24361a7ae293 [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",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090078 "USE_DBUS=${use.dbus}",
79 "USE_FEC=0",
80 "USE_HWID_OVERRIDE=${use.hwid_override}",
81 "USE_CHROME_KIOSK_APP=${use.chrome_kiosk_app}",
82 "USE_CHROME_NETWORK_PROXY=${use.chrome_network_proxy}",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090083 "USE_SHILL=1",
84 ]
85 include_dirs = [
86 # We need this include dir because we include all the local code as
87 # "update_engine/...".
88 "${platform2_root}",
89 "${platform2_root}/update_engine/client_library/include",
90 ]
Clark Chunge6b888c2020-04-20 15:50:37 +080091
92 # NOSORT
Keigo Oka0ede7bd2019-05-13 17:35:13 +090093 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +090094 "libbrillo",
Keigo Oka0ede7bd2019-05-13 17:35:13 +090095 "libchrome-${libbase_ver}",
96
97 # system_api depends on protobuf (or protobuf-lite). It must appear
98 # before protobuf here or the linker flags won't be in the right
99 # order.
100 "system_api",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900101 ]
Allen Webb816193f2019-10-25 10:06:46 -0700102 if (use.fuzzer) {
103 pkg_deps += [ "protobuf" ]
104 } else {
105 pkg_deps += [ "protobuf-lite" ]
106 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900107}
108
109# Protobufs.
110proto_library("update_metadata-protos") {
111 proto_in_dir = "."
112 proto_out_dir = "include/update_engine"
Clark Chunge6b888c2020-04-20 15:50:37 +0800113 sources = [ "update_metadata.proto" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900114}
115
116# Chrome D-Bus bindings.
117generate_dbus_adaptors("update_engine-dbus-adaptor") {
118 dbus_adaptors_out_dir = "include/dbus_bindings"
Clark Chunge6b888c2020-04-20 15:50:37 +0800119 sources = [ "dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900120}
121
122generate_dbus_proxies("update_engine-dbus-kiosk-app-client") {
123 mock_output_file = "include/kiosk-app/dbus-proxy-mocks.h"
124 proxy_output_file = "include/kiosk-app/dbus-proxies.h"
Clark Chunge6b888c2020-04-20 15:50:37 +0800125 sources = [ "dbus_bindings/org.chromium.KioskAppService.dbus-xml" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900126}
127
128# The payload application component and common dependencies.
129static_library("libpayload_consumer") {
130 sources = [
131 "common/action_processor.cc",
132 "common/boot_control_stub.cc",
133 "common/clock.cc",
134 "common/constants.cc",
135 "common/cpu_limiter.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700136 "common/dynamic_partition_control_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900137 "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",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700151 "payload_consumer/certificate_parser_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900152 "payload_consumer/delta_performer.cc",
153 "payload_consumer/download_action.cc",
154 "payload_consumer/extent_reader.cc",
155 "payload_consumer/extent_writer.cc",
156 "payload_consumer/file_descriptor.cc",
157 "payload_consumer/file_descriptor_utils.cc",
158 "payload_consumer/file_writer.cc",
159 "payload_consumer/filesystem_verifier_action.cc",
160 "payload_consumer/install_plan.cc",
161 "payload_consumer/mount_history.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700162 "payload_consumer/partition_update_generator_stub.cc",
Kelvin Zhang94f51cc2020-09-25 11:34:49 -0400163 "payload_consumer/partition_writer_factory_chromeos.cc",
164 "payload_consumer/partition_writer.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900165 "payload_consumer/payload_constants.cc",
166 "payload_consumer/payload_metadata.cc",
167 "payload_consumer/payload_verifier.cc",
168 "payload_consumer/postinstall_runner_action.cc",
169 "payload_consumer/verity_writer_stub.cc",
170 "payload_consumer/xz_extent_writer.cc",
171 ]
172 configs += [ ":target_defaults" ]
173 libs = [
174 "bz2",
175 "rt",
176 ]
177
Allen Webb975e8662020-05-14 14:33:13 -0700178 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
179 # declarations.
180 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
181
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900182 # TODO(deymo): Remove unused dependencies once we stop including files
183 # from the root directory.
184 all_dependent_pkg_deps = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900185 "libbspatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800186 "libcrypto",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900187 "libpuffpatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800188 "xz-embedded",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900189 ]
Tatsuhisa Yamaguchi74e47d92020-05-27 05:32:16 +0000190 public_deps = [ ":update_metadata-protos" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900191}
192
193# The main daemon static_library with all the code used to check for updates
194# with Omaha and expose a DBus daemon.
195static_library("libupdate_engine") {
196 sources = [
197 "boot_control_chromeos.cc",
198 "certificate_checker.cc",
199 "common_service.cc",
200 "connection_manager.cc",
201 "connection_utils.cc",
Amin Hassani565331e2019-06-24 14:11:29 -0700202 "daemon_chromeos.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900203 "dbus_connection.cc",
204 "dbus_service.cc",
205 "hardware_chromeos.cc",
206 "image_properties_chromeos.cc",
207 "libcurl_http_fetcher.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700208 "logging.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900209 "metrics_reporter_omaha.cc",
210 "metrics_utils.cc",
211 "omaha_request_action.cc",
212 "omaha_request_builder_xml.cc",
213 "omaha_request_params.cc",
214 "omaha_response_handler_action.cc",
215 "omaha_utils.cc",
216 "p2p_manager.cc",
217 "payload_state.cc",
218 "power_manager_chromeos.cc",
219 "real_system_state.cc",
220 "shill_proxy.cc",
221 "update_attempter.cc",
222 "update_boot_flags_action.cc",
223 "update_manager/boxed_value.cc",
224 "update_manager/chromeos_policy.cc",
225 "update_manager/default_policy.cc",
226 "update_manager/enough_slots_ab_updates_policy_impl.cc",
227 "update_manager/enterprise_device_policy_impl.cc",
228 "update_manager/evaluation_context.cc",
229 "update_manager/interactive_update_policy_impl.cc",
230 "update_manager/next_update_check_policy_impl.cc",
231 "update_manager/official_build_check_policy_impl.cc",
232 "update_manager/out_of_box_experience_policy_impl.cc",
233 "update_manager/policy.cc",
234 "update_manager/policy_test_utils.cc",
235 "update_manager/real_config_provider.cc",
236 "update_manager/real_device_policy_provider.cc",
237 "update_manager/real_random_provider.cc",
238 "update_manager/real_shill_provider.cc",
239 "update_manager/real_system_provider.cc",
240 "update_manager/real_time_provider.cc",
241 "update_manager/real_updater_provider.cc",
242 "update_manager/staging_utils.cc",
243 "update_manager/state_factory.cc",
244 "update_manager/update_manager.cc",
245 "update_manager/update_time_restrictions_policy_impl.cc",
246 "update_manager/weekly_time.cc",
247 "update_status_utils.cc",
248 ]
249 configs += [ ":target_defaults" ]
250 libs = [
251 "bz2",
Grace Chamb6d1b412019-10-31 14:53:42 +0900252 "policy",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900253 "rootdev",
254 "rt",
255 ]
256 all_dependent_pkg_deps = [
257 "dbus-1",
258 "expat",
259 "libcurl",
260 "libdebugd-client",
261 "libmetrics-${libbase_ver}",
262 "libpower_manager-client",
263 "libsession_manager-client",
264 "libshill-client",
265 "libssl",
266 "libupdate_engine-client",
267 "vboot_host",
268 ]
269 deps = [
270 ":libpayload_consumer",
271 ":update_engine-dbus-adaptor",
272 ":update_metadata-protos",
273 ]
274
275 if (use.dlc) {
276 all_dependent_pkg_deps += [ "libdlcservice-client" ]
277 }
278
279 if (use.chrome_network_proxy) {
280 sources += [ "chrome_browser_proxy_resolver.cc" ]
281 }
282
283 if (use.chrome_kiosk_app) {
284 deps += [ ":update_engine-dbus-kiosk-app-client" ]
285 }
286
287 if (use.dlc) {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700288 sources += [
289 "dlcservice_chromeos.cc",
290 "excluder_chromeos.cc",
291 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900292 } else {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700293 sources += [
294 "common/dlcservice_stub.cc",
295 "common/excluder_stub.cc",
296 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900297 }
298}
299
300# update_engine daemon.
301executable("update_engine") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800302 sources = [ "main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900303 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800304 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900305}
306
307# update_engine client library.
308static_library("libupdate_engine_client") {
309 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900310 "client_library/client_dbus.cc",
311 "update_status_utils.cc",
312 ]
313 include_dirs = [ "client_library/include" ]
314 configs += [ ":target_defaults" ]
315 pkg_deps = [
316 "dbus-1",
317 "libupdate_engine-client",
318 ]
319}
320
321# update_engine console client.
322executable("update_engine_client") {
323 sources = [
324 "common/error_code_utils.cc",
325 "omaha_utils.cc",
326 "update_engine_client.cc",
327 ]
328 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800329 deps = [ ":libupdate_engine_client" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900330}
331
332# server-side code. This is used for delta_generator and unittests but not
333# for any client code.
334static_library("libpayload_generator") {
335 sources = [
336 "common/file_fetcher.cc",
337 "payload_generator/ab_generator.cc",
338 "payload_generator/annotated_operation.cc",
339 "payload_generator/blob_file_writer.cc",
340 "payload_generator/block_mapping.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700341 "payload_generator/boot_img_filesystem_stub.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900342 "payload_generator/bzip.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900343 "payload_generator/deflate_utils.cc",
344 "payload_generator/delta_diff_generator.cc",
345 "payload_generator/delta_diff_utils.cc",
346 "payload_generator/ext2_filesystem.cc",
347 "payload_generator/extent_ranges.cc",
348 "payload_generator/extent_utils.cc",
349 "payload_generator/full_update_generator.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900350 "payload_generator/mapfile_filesystem.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700351 "payload_generator/merge_sequence_generator.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900352 "payload_generator/payload_file.cc",
353 "payload_generator/payload_generation_config.cc",
354 "payload_generator/payload_generation_config_chromeos.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700355 "payload_generator/payload_properties.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900356 "payload_generator/payload_signer.cc",
357 "payload_generator/raw_filesystem.cc",
358 "payload_generator/squashfs_filesystem.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900359 "payload_generator/xz_chromeos.cc",
360 ]
361 configs += [ ":target_defaults" ]
362 all_dependent_pkg_deps = [
363 "ext2fs",
364 "libbsdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900365 "liblzma",
Clark Chunge6b888c2020-04-20 15:50:37 +0800366 "libpuffdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900367 ]
368 deps = [
369 ":libpayload_consumer",
370 ":update_metadata-protos",
371 ]
Allen Webb975e8662020-05-14 14:33:13 -0700372
373 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
374 # declarations.
375 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900376}
377
378# server-side delta generator.
379executable("delta_generator") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800380 sources = [ "payload_generator/generate_delta_main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900381 configs += [ ":target_defaults" ]
382 configs -= [ "//common-mk:pie" ]
383 deps = [
384 ":libpayload_consumer",
385 ":libpayload_generator",
386 ]
387}
388
389if (use.test || use.fuzzer) {
390 static_library("update_engine_test_libs") {
391 sources = [
392 "common/fake_prefs.cc",
393 "common/mock_http_fetcher.cc",
394 "common/test_utils.cc",
395 "fake_shill_proxy.cc",
396 "fake_system_state.cc",
397 "payload_consumer/fake_file_descriptor.cc",
398 "payload_generator/fake_filesystem.cc",
399 "update_manager/umtest_utils.cc",
400 ]
Keigo Okaec39a222019-06-27 13:51:07 +0900401
402 # TODO(crbug.com/887845): After library odering issue is fixed,
403 # //common-mk:test can be moved in all_dependent_configs and
404 # //common-mk:test in each test configs can be removed.
405 configs += [
406 "//common-mk:test",
407 ":target_defaults",
408 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900409 pkg_deps = [ "libshill-client-test" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800410 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900411 }
412}
413
414if (use.test) {
415 # Public keys used for unit testing.
416 genopenssl_key("update_engine-testkeys") {
417 openssl_pem_in_dir = "."
418 openssl_pem_out_dir = "include/update_engine"
419 sources = [
420 "unittest_key.pem",
421 "unittest_key2.pem",
422 ]
423 }
424
425 # Unpacks sample images used for testing.
426 tar_bunzip2("update_engine-test_images") {
427 image_out_dir = "."
Clark Chunge6b888c2020-04-20 15:50:37 +0800428 sources = [ "sample_images/sample_images.tar.bz2" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900429 }
430
431 # Test HTTP Server.
432 executable("test_http_server") {
433 sources = [
434 "common/http_common.cc",
435 "test_http_server.cc",
436 ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700437
Keigo Okaec39a222019-06-27 13:51:07 +0900438 # //common-mk:test should be on the top.
439 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
440 configs += [
441 "//common-mk:test",
442 ":target_defaults",
443 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900444 }
445
446 # Test subprocess helper.
447 executable("test_subprocess") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800448 sources = [ "test_subprocess.cc" ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700449
Keigo Okaec39a222019-06-27 13:51:07 +0900450 # //common-mk:test should be on the top.
451 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
452 configs += [
453 "//common-mk:test",
454 ":target_defaults",
455 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900456 }
457
458 # Main unittest file.
459 executable("update_engine_unittests") {
460 sources = [
461 "boot_control_chromeos_unittest.cc",
462 "certificate_checker_unittest.cc",
463 "common/action_pipe_unittest.cc",
464 "common/action_processor_unittest.cc",
465 "common/action_unittest.cc",
466 "common/cpu_limiter_unittest.cc",
467 "common/hash_calculator_unittest.cc",
468 "common/http_fetcher_unittest.cc",
469 "common/hwid_override_unittest.cc",
470 "common/prefs_unittest.cc",
471 "common/proxy_resolver_unittest.cc",
472 "common/subprocess_unittest.cc",
473 "common/terminator_unittest.cc",
474 "common/utils_unittest.cc",
475 "common_service_unittest.cc",
476 "connection_manager_unittest.cc",
477 "hardware_chromeos_unittest.cc",
478 "image_properties_chromeos_unittest.cc",
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700479 "libcurl_http_fetcher_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900480 "metrics_reporter_omaha_unittest.cc",
481 "metrics_utils_unittest.cc",
482 "omaha_request_action_unittest.cc",
483 "omaha_request_builder_xml_unittest.cc",
484 "omaha_request_params_unittest.cc",
485 "omaha_response_handler_action_unittest.cc",
486 "omaha_utils_unittest.cc",
487 "p2p_manager_unittest.cc",
488 "payload_consumer/bzip_extent_writer_unittest.cc",
489 "payload_consumer/cached_file_descriptor_unittest.cc",
490 "payload_consumer/delta_performer_integration_test.cc",
491 "payload_consumer/delta_performer_unittest.cc",
492 "payload_consumer/download_action_unittest.cc",
493 "payload_consumer/extent_reader_unittest.cc",
494 "payload_consumer/extent_writer_unittest.cc",
495 "payload_consumer/file_descriptor_utils_unittest.cc",
496 "payload_consumer/file_writer_unittest.cc",
497 "payload_consumer/filesystem_verifier_action_unittest.cc",
498 "payload_consumer/postinstall_runner_action_unittest.cc",
499 "payload_consumer/xz_extent_writer_unittest.cc",
500 "payload_generator/ab_generator_unittest.cc",
501 "payload_generator/blob_file_writer_unittest.cc",
502 "payload_generator/block_mapping_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900503 "payload_generator/deflate_utils_unittest.cc",
504 "payload_generator/delta_diff_utils_unittest.cc",
505 "payload_generator/ext2_filesystem_unittest.cc",
506 "payload_generator/extent_ranges_unittest.cc",
507 "payload_generator/extent_utils_unittest.cc",
508 "payload_generator/full_update_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900509 "payload_generator/mapfile_filesystem_unittest.cc",
Amin Hassanid0ec6512020-09-15 15:30:08 -0700510 "payload_generator/merge_sequence_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900511 "payload_generator/payload_file_unittest.cc",
512 "payload_generator/payload_generation_config_unittest.cc",
Jae Hoon Kim4b6d1262019-06-20 10:41:18 -0700513 "payload_generator/payload_properties_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900514 "payload_generator/payload_signer_unittest.cc",
515 "payload_generator/squashfs_filesystem_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900516 "payload_generator/zip_unittest.cc",
517 "payload_state_unittest.cc",
518 "testrunner.cc",
519 "update_attempter_unittest.cc",
520 "update_boot_flags_action_unittest.cc",
521 "update_manager/boxed_value_unittest.cc",
522 "update_manager/chromeos_policy_unittest.cc",
523 "update_manager/evaluation_context_unittest.cc",
524 "update_manager/generic_variables_unittest.cc",
525 "update_manager/prng_unittest.cc",
526 "update_manager/real_device_policy_provider_unittest.cc",
527 "update_manager/real_random_provider_unittest.cc",
528 "update_manager/real_shill_provider_unittest.cc",
529 "update_manager/real_system_provider_unittest.cc",
530 "update_manager/real_time_provider_unittest.cc",
531 "update_manager/real_updater_provider_unittest.cc",
532 "update_manager/staging_utils_unittest.cc",
533 "update_manager/update_manager_unittest.cc",
534 "update_manager/update_time_restrictions_policy_impl_unittest.cc",
535 "update_manager/variable_unittest.cc",
536 "update_manager/weekly_time_unittest.cc",
Jae Hoon Kim916af852019-08-01 17:45:30 -0700537 "update_status_utils_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900538 ]
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700539 if (use.dlc) {
540 sources += [ "excluder_chromeos_unittest.cc" ]
541 }
Brian Norris0ffa71f2019-07-08 10:25:54 -0700542
Keigo Okaec39a222019-06-27 13:51:07 +0900543 # //common-mk:test should be on the top.
544 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
545 configs += [
546 "//common-mk:test",
547 ":target_defaults",
548 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900549 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900550 "libbrillo-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900551 "libchrome-test-${libbase_ver}",
552 "libdebugd-client-test",
553 "libpower_manager-client-test",
554 "libsession_manager-client-test",
555 "libshill-client-test",
556 ]
557 deps = [
558 ":libpayload_generator",
559 ":libupdate_engine",
560 ":update_engine_test_libs",
561 ]
562 }
563}
564
565# Fuzzer target.
566if (use.fuzzer) {
Amin Hassani6f0366d2019-10-14 14:56:43 -0700567 executable("update_engine_delta_performer_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800568 sources = [ "payload_consumer/delta_performer_fuzzer.cc" ]
Amin Hassani6f0366d2019-10-14 14:56:43 -0700569 configs += [
570 "//common-mk/common_fuzzer",
571 ":target_defaults",
572 ]
573 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900574 "libbrillo-test",
Amin Hassani6f0366d2019-10-14 14:56:43 -0700575 "libchrome-test-${libbase_ver}",
576 ]
577 deps = [
578 ":libupdate_engine",
579 ":update_engine_test_libs",
580 ]
581 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900582 executable("update_engine_omaha_request_action_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800583 sources = [ "omaha_request_action_fuzzer.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900584 configs += [
585 "//common-mk/common_fuzzer",
586 ":target_defaults",
587 ]
588 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900589 "libbrillo-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900590 "libchrome-test-${libbase_ver}",
591 ]
592 deps = [
593 ":libupdate_engine",
594 ":update_engine_test_libs",
595 ]
596 }
597}