blob: 7961fe1885fc37002426da0737600b45771e0faf [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",
136 "common/error_code_utils.cc",
137 "common/hash_calculator.cc",
138 "common/http_common.cc",
139 "common/http_fetcher.cc",
140 "common/hwid_override.cc",
141 "common/multi_range_http_fetcher.cc",
142 "common/platform_constants_chromeos.cc",
143 "common/prefs.cc",
144 "common/proxy_resolver.cc",
145 "common/subprocess.cc",
146 "common/terminator.cc",
147 "common/utils.cc",
148 "payload_consumer/bzip_extent_writer.cc",
149 "payload_consumer/cached_file_descriptor.cc",
150 "payload_consumer/delta_performer.cc",
151 "payload_consumer/download_action.cc",
152 "payload_consumer/extent_reader.cc",
153 "payload_consumer/extent_writer.cc",
154 "payload_consumer/file_descriptor.cc",
155 "payload_consumer/file_descriptor_utils.cc",
156 "payload_consumer/file_writer.cc",
157 "payload_consumer/filesystem_verifier_action.cc",
158 "payload_consumer/install_plan.cc",
159 "payload_consumer/mount_history.cc",
160 "payload_consumer/payload_constants.cc",
161 "payload_consumer/payload_metadata.cc",
162 "payload_consumer/payload_verifier.cc",
163 "payload_consumer/postinstall_runner_action.cc",
164 "payload_consumer/verity_writer_stub.cc",
165 "payload_consumer/xz_extent_writer.cc",
166 ]
167 configs += [ ":target_defaults" ]
168 libs = [
169 "bz2",
170 "rt",
171 ]
172
Allen Webb975e8662020-05-14 14:33:13 -0700173 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
174 # declarations.
175 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
176
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900177 # TODO(deymo): Remove unused dependencies once we stop including files
178 # from the root directory.
179 all_dependent_pkg_deps = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900180 "libbspatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800181 "libcrypto",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900182 "libpuffpatch",
Clark Chunge6b888c2020-04-20 15:50:37 +0800183 "xz-embedded",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900184 ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800185 deps = [ ":update_metadata-protos" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900186}
187
188# The main daemon static_library with all the code used to check for updates
189# with Omaha and expose a DBus daemon.
190static_library("libupdate_engine") {
191 sources = [
192 "boot_control_chromeos.cc",
193 "certificate_checker.cc",
194 "common_service.cc",
195 "connection_manager.cc",
196 "connection_utils.cc",
Amin Hassani565331e2019-06-24 14:11:29 -0700197 "daemon_chromeos.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900198 "dbus_connection.cc",
199 "dbus_service.cc",
200 "hardware_chromeos.cc",
201 "image_properties_chromeos.cc",
202 "libcurl_http_fetcher.cc",
203 "metrics_reporter_omaha.cc",
204 "metrics_utils.cc",
205 "omaha_request_action.cc",
206 "omaha_request_builder_xml.cc",
207 "omaha_request_params.cc",
208 "omaha_response_handler_action.cc",
209 "omaha_utils.cc",
210 "p2p_manager.cc",
211 "payload_state.cc",
212 "power_manager_chromeos.cc",
213 "real_system_state.cc",
214 "shill_proxy.cc",
215 "update_attempter.cc",
216 "update_boot_flags_action.cc",
217 "update_manager/boxed_value.cc",
218 "update_manager/chromeos_policy.cc",
219 "update_manager/default_policy.cc",
220 "update_manager/enough_slots_ab_updates_policy_impl.cc",
221 "update_manager/enterprise_device_policy_impl.cc",
222 "update_manager/evaluation_context.cc",
223 "update_manager/interactive_update_policy_impl.cc",
224 "update_manager/next_update_check_policy_impl.cc",
225 "update_manager/official_build_check_policy_impl.cc",
226 "update_manager/out_of_box_experience_policy_impl.cc",
227 "update_manager/policy.cc",
228 "update_manager/policy_test_utils.cc",
229 "update_manager/real_config_provider.cc",
230 "update_manager/real_device_policy_provider.cc",
231 "update_manager/real_random_provider.cc",
232 "update_manager/real_shill_provider.cc",
233 "update_manager/real_system_provider.cc",
234 "update_manager/real_time_provider.cc",
235 "update_manager/real_updater_provider.cc",
236 "update_manager/staging_utils.cc",
237 "update_manager/state_factory.cc",
238 "update_manager/update_manager.cc",
239 "update_manager/update_time_restrictions_policy_impl.cc",
240 "update_manager/weekly_time.cc",
241 "update_status_utils.cc",
242 ]
243 configs += [ ":target_defaults" ]
244 libs = [
245 "bz2",
Grace Chamb6d1b412019-10-31 14:53:42 +0900246 "policy",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900247 "rootdev",
248 "rt",
249 ]
250 all_dependent_pkg_deps = [
251 "dbus-1",
252 "expat",
253 "libcurl",
254 "libdebugd-client",
255 "libmetrics-${libbase_ver}",
256 "libpower_manager-client",
257 "libsession_manager-client",
258 "libshill-client",
259 "libssl",
260 "libupdate_engine-client",
261 "vboot_host",
262 ]
263 deps = [
264 ":libpayload_consumer",
265 ":update_engine-dbus-adaptor",
266 ":update_metadata-protos",
267 ]
268
269 if (use.dlc) {
270 all_dependent_pkg_deps += [ "libdlcservice-client" ]
271 }
272
273 if (use.chrome_network_proxy) {
274 sources += [ "chrome_browser_proxy_resolver.cc" ]
275 }
276
277 if (use.chrome_kiosk_app) {
278 deps += [ ":update_engine-dbus-kiosk-app-client" ]
279 }
280
281 if (use.dlc) {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700282 sources += [
283 "dlcservice_chromeos.cc",
284 "excluder_chromeos.cc",
285 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900286 } else {
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700287 sources += [
288 "common/dlcservice_stub.cc",
289 "common/excluder_stub.cc",
290 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900291 }
292}
293
294# update_engine daemon.
295executable("update_engine") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800296 sources = [ "main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900297 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800298 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900299}
300
301# update_engine client library.
302static_library("libupdate_engine_client") {
303 sources = [
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900304 "client_library/client_dbus.cc",
305 "update_status_utils.cc",
306 ]
307 include_dirs = [ "client_library/include" ]
308 configs += [ ":target_defaults" ]
309 pkg_deps = [
310 "dbus-1",
311 "libupdate_engine-client",
312 ]
313}
314
315# update_engine console client.
316executable("update_engine_client") {
317 sources = [
318 "common/error_code_utils.cc",
319 "omaha_utils.cc",
320 "update_engine_client.cc",
321 ]
322 configs += [ ":target_defaults" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800323 deps = [ ":libupdate_engine_client" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900324}
325
326# server-side code. This is used for delta_generator and unittests but not
327# for any client code.
328static_library("libpayload_generator") {
329 sources = [
330 "common/file_fetcher.cc",
331 "payload_generator/ab_generator.cc",
332 "payload_generator/annotated_operation.cc",
333 "payload_generator/blob_file_writer.cc",
334 "payload_generator/block_mapping.cc",
335 "payload_generator/boot_img_filesystem.cc",
336 "payload_generator/bzip.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900337 "payload_generator/deflate_utils.cc",
338 "payload_generator/delta_diff_generator.cc",
339 "payload_generator/delta_diff_utils.cc",
340 "payload_generator/ext2_filesystem.cc",
341 "payload_generator/extent_ranges.cc",
342 "payload_generator/extent_utils.cc",
343 "payload_generator/full_update_generator.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900344 "payload_generator/mapfile_filesystem.cc",
345 "payload_generator/payload_file.cc",
346 "payload_generator/payload_generation_config.cc",
347 "payload_generator/payload_generation_config_chromeos.cc",
Amin Hassani79821002019-05-06 17:40:49 -0700348 "payload_generator/payload_properties.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900349 "payload_generator/payload_signer.cc",
350 "payload_generator/raw_filesystem.cc",
351 "payload_generator/squashfs_filesystem.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900352 "payload_generator/xz_chromeos.cc",
353 ]
354 configs += [ ":target_defaults" ]
355 all_dependent_pkg_deps = [
356 "ext2fs",
357 "libbsdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900358 "liblzma",
Clark Chunge6b888c2020-04-20 15:50:37 +0800359 "libpuffdiff",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900360 ]
361 deps = [
362 ":libpayload_consumer",
363 ":update_metadata-protos",
364 ]
Allen Webb975e8662020-05-14 14:33:13 -0700365
366 # TODO(crbug.com/1082873): Remove after fixing usage of deprecated
367 # declarations.
368 cflags_cc = [ "-Wno-error=deprecated-declarations" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900369}
370
371# server-side delta generator.
372executable("delta_generator") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800373 sources = [ "payload_generator/generate_delta_main.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900374 configs += [ ":target_defaults" ]
375 configs -= [ "//common-mk:pie" ]
376 deps = [
377 ":libpayload_consumer",
378 ":libpayload_generator",
379 ]
380}
381
382if (use.test || use.fuzzer) {
383 static_library("update_engine_test_libs") {
384 sources = [
385 "common/fake_prefs.cc",
386 "common/mock_http_fetcher.cc",
387 "common/test_utils.cc",
388 "fake_shill_proxy.cc",
389 "fake_system_state.cc",
390 "payload_consumer/fake_file_descriptor.cc",
391 "payload_generator/fake_filesystem.cc",
392 "update_manager/umtest_utils.cc",
393 ]
Keigo Okaec39a222019-06-27 13:51:07 +0900394
395 # TODO(crbug.com/887845): After library odering issue is fixed,
396 # //common-mk:test can be moved in all_dependent_configs and
397 # //common-mk:test in each test configs can be removed.
398 configs += [
399 "//common-mk:test",
400 ":target_defaults",
401 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900402 pkg_deps = [ "libshill-client-test" ]
Clark Chunge6b888c2020-04-20 15:50:37 +0800403 deps = [ ":libupdate_engine" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900404 }
405}
406
407if (use.test) {
408 # Public keys used for unit testing.
409 genopenssl_key("update_engine-testkeys") {
410 openssl_pem_in_dir = "."
411 openssl_pem_out_dir = "include/update_engine"
412 sources = [
413 "unittest_key.pem",
414 "unittest_key2.pem",
415 ]
416 }
417
418 # Unpacks sample images used for testing.
419 tar_bunzip2("update_engine-test_images") {
420 image_out_dir = "."
Clark Chunge6b888c2020-04-20 15:50:37 +0800421 sources = [ "sample_images/sample_images.tar.bz2" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900422 }
423
424 # Test HTTP Server.
425 executable("test_http_server") {
426 sources = [
427 "common/http_common.cc",
428 "test_http_server.cc",
429 ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700430
Keigo Okaec39a222019-06-27 13:51:07 +0900431 # //common-mk:test should be on the top.
432 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
433 configs += [
434 "//common-mk:test",
435 ":target_defaults",
436 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900437 }
438
439 # Test subprocess helper.
440 executable("test_subprocess") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800441 sources = [ "test_subprocess.cc" ]
Brian Norris0ffa71f2019-07-08 10:25:54 -0700442
Keigo Okaec39a222019-06-27 13:51:07 +0900443 # //common-mk:test should be on the top.
444 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
445 configs += [
446 "//common-mk:test",
447 ":target_defaults",
448 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900449 }
450
451 # Main unittest file.
452 executable("update_engine_unittests") {
453 sources = [
454 "boot_control_chromeos_unittest.cc",
455 "certificate_checker_unittest.cc",
456 "common/action_pipe_unittest.cc",
457 "common/action_processor_unittest.cc",
458 "common/action_unittest.cc",
459 "common/cpu_limiter_unittest.cc",
460 "common/hash_calculator_unittest.cc",
461 "common/http_fetcher_unittest.cc",
462 "common/hwid_override_unittest.cc",
463 "common/prefs_unittest.cc",
464 "common/proxy_resolver_unittest.cc",
465 "common/subprocess_unittest.cc",
466 "common/terminator_unittest.cc",
467 "common/utils_unittest.cc",
468 "common_service_unittest.cc",
469 "connection_manager_unittest.cc",
470 "hardware_chromeos_unittest.cc",
471 "image_properties_chromeos_unittest.cc",
Jae Hoon Kim0ae8fe12019-06-26 14:32:50 -0700472 "libcurl_http_fetcher_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900473 "metrics_reporter_omaha_unittest.cc",
474 "metrics_utils_unittest.cc",
475 "omaha_request_action_unittest.cc",
476 "omaha_request_builder_xml_unittest.cc",
477 "omaha_request_params_unittest.cc",
478 "omaha_response_handler_action_unittest.cc",
479 "omaha_utils_unittest.cc",
480 "p2p_manager_unittest.cc",
481 "payload_consumer/bzip_extent_writer_unittest.cc",
482 "payload_consumer/cached_file_descriptor_unittest.cc",
483 "payload_consumer/delta_performer_integration_test.cc",
484 "payload_consumer/delta_performer_unittest.cc",
485 "payload_consumer/download_action_unittest.cc",
486 "payload_consumer/extent_reader_unittest.cc",
487 "payload_consumer/extent_writer_unittest.cc",
488 "payload_consumer/file_descriptor_utils_unittest.cc",
489 "payload_consumer/file_writer_unittest.cc",
490 "payload_consumer/filesystem_verifier_action_unittest.cc",
491 "payload_consumer/postinstall_runner_action_unittest.cc",
492 "payload_consumer/xz_extent_writer_unittest.cc",
493 "payload_generator/ab_generator_unittest.cc",
494 "payload_generator/blob_file_writer_unittest.cc",
495 "payload_generator/block_mapping_unittest.cc",
496 "payload_generator/boot_img_filesystem_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900497 "payload_generator/deflate_utils_unittest.cc",
498 "payload_generator/delta_diff_utils_unittest.cc",
499 "payload_generator/ext2_filesystem_unittest.cc",
500 "payload_generator/extent_ranges_unittest.cc",
501 "payload_generator/extent_utils_unittest.cc",
502 "payload_generator/full_update_generator_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900503 "payload_generator/mapfile_filesystem_unittest.cc",
504 "payload_generator/payload_file_unittest.cc",
505 "payload_generator/payload_generation_config_unittest.cc",
Jae Hoon Kim4b6d1262019-06-20 10:41:18 -0700506 "payload_generator/payload_properties_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900507 "payload_generator/payload_signer_unittest.cc",
508 "payload_generator/squashfs_filesystem_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900509 "payload_generator/zip_unittest.cc",
510 "payload_state_unittest.cc",
511 "testrunner.cc",
512 "update_attempter_unittest.cc",
513 "update_boot_flags_action_unittest.cc",
514 "update_manager/boxed_value_unittest.cc",
515 "update_manager/chromeos_policy_unittest.cc",
516 "update_manager/evaluation_context_unittest.cc",
517 "update_manager/generic_variables_unittest.cc",
518 "update_manager/prng_unittest.cc",
519 "update_manager/real_device_policy_provider_unittest.cc",
520 "update_manager/real_random_provider_unittest.cc",
521 "update_manager/real_shill_provider_unittest.cc",
522 "update_manager/real_system_provider_unittest.cc",
523 "update_manager/real_time_provider_unittest.cc",
524 "update_manager/real_updater_provider_unittest.cc",
525 "update_manager/staging_utils_unittest.cc",
526 "update_manager/update_manager_unittest.cc",
527 "update_manager/update_time_restrictions_policy_impl_unittest.cc",
528 "update_manager/variable_unittest.cc",
529 "update_manager/weekly_time_unittest.cc",
Jae Hoon Kim916af852019-08-01 17:45:30 -0700530 "update_status_utils_unittest.cc",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900531 ]
Jae Hoon Kim38de3b12020-04-29 19:41:23 -0700532 if (use.dlc) {
533 sources += [ "excluder_chromeos_unittest.cc" ]
534 }
Brian Norris0ffa71f2019-07-08 10:25:54 -0700535
Keigo Okaec39a222019-06-27 13:51:07 +0900536 # //common-mk:test should be on the top.
537 # TODO(crbug.com/887845): Remove this after library odering issue is fixed.
538 configs += [
539 "//common-mk:test",
540 ":target_defaults",
541 ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900542 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900543 "libbrillo-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900544 "libchrome-test-${libbase_ver}",
545 "libdebugd-client-test",
546 "libpower_manager-client-test",
547 "libsession_manager-client-test",
548 "libshill-client-test",
549 ]
550 deps = [
551 ":libpayload_generator",
552 ":libupdate_engine",
553 ":update_engine_test_libs",
554 ]
555 }
556}
557
558# Fuzzer target.
559if (use.fuzzer) {
Amin Hassani6f0366d2019-10-14 14:56:43 -0700560 executable("update_engine_delta_performer_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800561 sources = [ "payload_consumer/delta_performer_fuzzer.cc" ]
Amin Hassani6f0366d2019-10-14 14:56:43 -0700562 configs += [
563 "//common-mk/common_fuzzer",
564 ":target_defaults",
565 ]
566 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900567 "libbrillo-test",
Amin Hassani6f0366d2019-10-14 14:56:43 -0700568 "libchrome-test-${libbase_ver}",
569 ]
570 deps = [
571 ":libupdate_engine",
572 ":update_engine_test_libs",
573 ]
574 }
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900575 executable("update_engine_omaha_request_action_fuzzer") {
Clark Chunge6b888c2020-04-20 15:50:37 +0800576 sources = [ "omaha_request_action_fuzzer.cc" ]
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900577 configs += [
578 "//common-mk/common_fuzzer",
579 ":target_defaults",
580 ]
581 pkg_deps = [
Grace Chamb6d1b412019-10-31 14:53:42 +0900582 "libbrillo-test",
Keigo Oka0ede7bd2019-05-13 17:35:13 +0900583 "libchrome-test-${libbase_ver}",
584 ]
585 deps = [
586 ":libupdate_engine",
587 ":update_engine_test_libs",
588 ]
589 }
590}