1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 # Test support files for the 'sync_core' target.
9 'target_name': 'test_support_sync_core',
10 'type': 'static_library',
11 'variables': { 'enable_wexit_time_destructors': 1, },
19 '../base/base.gyp:base',
20 '../testing/gmock.gyp:gmock',
21 '../testing/gtest.gyp:gtest',
24 'export_dependent_settings': [
25 '../testing/gmock.gyp:gmock',
26 '../testing/gtest.gyp:gtest',
32 'sessions/test_util.cc',
33 'sessions/test_util.h',
34 'test/callback_counter.h',
35 'test/engine/fake_model_worker.cc',
36 'test/engine/fake_model_worker.h',
37 'test/engine/fake_sync_scheduler.cc',
38 'test/engine/fake_sync_scheduler.h',
39 'test/engine/mock_connection_manager.cc',
40 'test/engine/mock_connection_manager.h',
41 'test/engine/syncer_command_test.cc',
42 'test/engine/syncer_command_test.h',
43 'test/engine/test_directory_setter_upper.cc',
44 'test/engine/test_directory_setter_upper.h',
45 'test/engine/test_id_factory.h',
46 'test/engine/test_syncable_utils.cc',
47 'test/engine/test_syncable_utils.h',
48 'test/fake_encryptor.cc',
49 'test/fake_encryptor.h',
50 'test/fake_sync_encryption_handler.h',
51 'test/fake_sync_encryption_handler.cc',
52 'test/fake_extensions_activity_monitor.cc',
53 'test/fake_extensions_activity_monitor.h',
54 'test/test_transaction_observer.cc',
55 'test/test_transaction_observer.h',
56 'test/null_directory_change_delegate.cc',
57 'test/null_directory_change_delegate.h',
58 'test/null_transaction_observer.cc',
59 'test/null_transaction_observer.h',
60 'test/sessions/test_scoped_session_event_listener.h',
61 'test/test_directory_backing_store.cc',
62 'test/test_directory_backing_store.h',
63 'util/test_unrecoverable_error_handler.cc',
64 'util/test_unrecoverable_error_handler.h',
68 # Test support files for the python sync test server.
70 'target_name': 'test_support_sync_testserver',
71 'type': 'static_library',
72 'variables': { 'enable_wexit_time_destructors': 1, },
77 '../base/base.gyp:base',
78 '../net/net.gyp:net_test_support',
79 # The sync test server uses Python modules generated by the sync protos.
80 '../third_party/protobuf/protobuf.gyp:py_proto',
83 'export_dependent_settings': [
84 '../base/base.gyp:base',
85 '../net/net.gyp:net_test_support',
88 'test/local_sync_test_server.cc',
89 'test/local_sync_test_server.h',
93 # Test support files for the 'sync_notifier' target.
95 'target_name': 'test_support_sync_notifier',
96 'type': 'static_library',
104 '../testing/gmock.gyp:gmock',
105 '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
108 'export_dependent_settings': [
109 '../testing/gmock.gyp:gmock',
110 '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
114 'notifier/fake_invalidation_state_tracker.cc',
115 'notifier/fake_invalidation_state_tracker.h',
116 'notifier/fake_invalidator.cc',
117 'notifier/fake_invalidator.h',
118 'notifier/fake_invalidation_handler.cc',
119 'notifier/fake_invalidation_handler.h',
120 'notifier/invalidator_test_template.cc',
121 'notifier/invalidator_test_template.h',
122 'notifier/object_id_invalidation_map_test_util.cc',
123 'notifier/object_id_invalidation_map_test_util.h',
127 # Test support files for the 'sync_internal_api' target.
129 'target_name': 'test_support_sync_internal_api',
130 'type': 'static_library',
131 'variables': { 'enable_wexit_time_destructors': 1, },
139 '../base/base.gyp:base',
140 '../testing/gtest.gyp:gtest',
142 'test_support_sync_core',
144 'export_dependent_settings': [
145 '../testing/gtest.gyp:gtest',
147 'test_support_sync_core',
150 'internal_api/public/base/invalidation_test_util.cc',
151 'internal_api/public/base/invalidation_test_util.h',
152 'internal_api/public/base/model_type_invalidation_map_test_util.cc',
153 'internal_api/public/base/model_type_invalidation_map_test_util.h',
154 'internal_api/public/base/model_type_test_util.cc',
155 'internal_api/public/base/model_type_test_util.h',
156 'internal_api/public/test/fake_sync_manager.h',
157 'internal_api/public/test/test_entry_factory.h',
158 'internal_api/public/test/test_internal_components_factory.h',
159 'internal_api/public/test/test_user_share.h',
160 'internal_api/test/fake_sync_manager.cc',
161 'internal_api/test/test_entry_factory.cc',
162 'internal_api/test/test_internal_components_factory.cc',
163 'internal_api/test/test_user_share.cc',
167 # Test support files for the 'sync_api' target.
169 'target_name': 'test_support_sync_api',
170 'type': 'static_library',
178 '../testing/gmock.gyp:gmock',
181 'export_dependent_settings': [
182 '../testing/gmock.gyp:gmock',
186 'api/fake_syncable_service.cc',
187 'api/fake_syncable_service.h',
188 'api/sync_error_factory_mock.cc',
189 'api/sync_error_factory_mock.h',
193 # Unit tests for the 'sync_core' target. This cannot be a static
194 # library because the unit test files have to be compiled directly
195 # into the executable, so we push the target files to the
196 # depending executable target via direct_dependent_settings.
198 'target_name': 'sync_core_tests',
200 # We only want unit test executables to include this target.
201 'suppress_wildcard': 1,
203 '../base/base.gyp:base',
204 '../sql/sql.gyp:sql',
205 '../testing/gmock.gyp:gmock',
206 '../testing/gtest.gyp:gtest',
208 'test_support_sync_core',
211 ['OS=="linux" and chromeos==1', {
212 # Required by get_session_name_unittest.cc on Chrome OS.
214 '../chromeos/chromeos.gyp:chromeos',
218 # Propagate all dependencies since the actual compilation
219 # happens in the dependents.
220 'export_dependent_settings': [
221 '../base/base.gyp:base',
222 '../sql/sql.gyp:sql',
223 '../testing/gmock.gyp:gmock',
224 '../testing/gtest.gyp:gtest',
226 'test_support_sync_core',
228 'direct_dependent_settings': {
233 'internal_api/public/base/enum_set_unittest.cc',
234 'internal_api/public/base/model_type_invalidation_map_unittest.cc',
235 'internal_api/public/base/node_ordinal_unittest.cc',
236 'internal_api/public/base/ordinal_unittest.cc',
237 'internal_api/public/base/unique_position_unittest.cc',
238 'internal_api/public/engine/model_safe_worker_unittest.cc',
239 'internal_api/public/util/immutable_unittest.cc',
240 'internal_api/public/util/weak_handle_unittest.cc',
241 'engine/apply_control_data_updates_unittest.cc',
242 'engine/apply_updates_and_resolve_conflicts_command_unittest.cc',
243 'engine/backoff_delay_provider_unittest.cc',
244 'engine/download_updates_command_unittest.cc',
245 'engine/model_changing_syncer_command_unittest.cc',
246 'engine/process_commit_response_command_unittest.cc',
247 'engine/process_updates_command_unittest.cc',
248 'engine/store_timestamps_command_unittest.cc',
249 'engine/sync_scheduler_unittest.cc',
250 'engine/syncer_proto_util_unittest.cc',
251 'engine/syncer_unittest.cc',
252 'engine/traffic_recorder_unittest.cc',
253 'js/js_arg_list_unittest.cc',
254 'js/js_event_details_unittest.cc',
255 'js/sync_js_controller_unittest.cc',
256 'protocol/proto_enum_conversions_unittest.cc',
257 'protocol/proto_value_conversions_unittest.cc',
258 'sessions/nudge_tracker_unittest.cc',
259 'sessions/ordered_commit_set_unittest.cc',
260 'sessions/status_controller_unittest.cc',
261 'sessions/sync_session_unittest.cc',
262 'syncable/directory_backing_store_unittest.cc',
263 'syncable/model_type_unittest.cc',
264 'syncable/nigori_util_unittest.cc',
265 'syncable/parent_child_index_unittest.cc',
266 'syncable/syncable_enum_conversions_unittest.cc',
267 'syncable/syncable_id_unittest.cc',
268 'syncable/syncable_unittest.cc',
269 'syncable/syncable_util_unittest.cc',
270 'util/cryptographer_unittest.cc',
271 'util/data_type_histogram_unittest.cc',
272 'util/get_session_name_unittest.cc',
273 'util/nigori_unittest.cc',
274 'util/protobuf_unittest.cc',
277 ['OS == "ios" and coverage != 0', {
279 # These sources can't be built with coverage due to a toolchain
280 # bug: http://openradar.appspot.com/radar?id=1499403
281 'engine/syncer_unittest.cc',
283 # These tests crash when run with coverage turned on due to an
284 # issue with llvm_gcda_increment_indirect_counter:
285 # http://crbug.com/156058
286 'syncable/directory_backing_store_unittest.cc',
293 # Unit tests for the 'sync_notifier' target. This cannot be a static
294 # library because the unit test files have to be compiled directly
295 # into the executable, so we push the target files to the
296 # depending executable target via direct_dependent_settings.
298 'target_name': 'sync_notifier_tests',
300 # We only want unit test executables to include this target.
301 'suppress_wildcard': 1,
303 '../base/base.gyp:base',
304 '../jingle/jingle.gyp:notifier_test_util',
305 '../net/net.gyp:net_test_support',
306 '../testing/gmock.gyp:gmock',
307 '../testing/gtest.gyp:gtest',
308 '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
309 '../third_party/libjingle/libjingle.gyp:libjingle',
311 'test_support_sync_notifier',
313 # Propagate all dependencies since the actual compilation
314 # happens in the dependents.
315 'export_dependent_settings': [
316 '../base/base.gyp:base',
317 '../jingle/jingle.gyp:notifier_test_util',
318 '../net/net.gyp:net_test_support',
319 '../testing/gmock.gyp:gmock',
320 '../testing/gtest.gyp:gtest',
321 '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
322 '../third_party/libjingle/libjingle.gyp:libjingle',
324 'test_support_sync_notifier',
326 'direct_dependent_settings': {
331 'notifier/invalidator_factory_unittest.cc',
334 ['OS != "android"', {
336 'notifier/ack_tracker_unittest.cc',
337 'notifier/fake_invalidator_unittest.cc',
338 'notifier/invalidation_notifier_unittest.cc',
339 'notifier/invalidator_registrar_unittest.cc',
340 'notifier/non_blocking_invalidator_unittest.cc',
341 'notifier/p2p_invalidator_unittest.cc',
342 'notifier/push_client_channel_unittest.cc',
343 'notifier/registration_manager_unittest.cc',
344 'notifier/sync_invalidation_listener_unittest.cc',
345 'notifier/sync_system_resources_unittest.cc',
352 # Unit tests for the 'sync_internal_api' target. This cannot be a static
353 # library because the unit test files have to be compiled directly
354 # into the executable, so we push the target files to the
355 # depending executable target via direct_dependent_settings.
357 'target_name': 'sync_internal_api_tests',
359 # We only want unit test executables to include this target.
360 'suppress_wildcard': 1,
362 '../base/base.gyp:base',
363 '../net/net.gyp:net',
364 '../net/net.gyp:net_test_support',
365 '../testing/gmock.gyp:gmock',
366 '../testing/gtest.gyp:gtest',
368 'test_support_sync_internal_api',
370 # Propagate all dependencies since the actual compilation
371 # happens in the dependents.
372 'export_dependent_settings': [
373 '../base/base.gyp:base',
374 '../net/net.gyp:net',
375 '../net/net.gyp:net_test_support',
376 '../testing/gmock.gyp:gmock',
377 '../testing/gtest.gyp:gtest',
379 'test_support_sync_internal_api',
381 'direct_dependent_settings': {
386 'internal_api/debug_info_event_listener_unittest.cc',
387 'internal_api/http_bridge_unittest.cc',
388 'internal_api/js_mutation_event_observer_unittest.cc',
389 'internal_api/js_sync_encryption_handler_observer_unittest.cc',
390 'internal_api/js_sync_manager_observer_unittest.cc',
391 'internal_api/public/change_record_unittest.cc',
392 'internal_api/public/sessions/sync_session_snapshot_unittest.cc',
393 'internal_api/public/sessions/sync_source_info_unittest.cc',
394 'internal_api/syncapi_server_connection_manager_unittest.cc',
395 'internal_api/sync_encryption_handler_impl_unittest.cc',
396 'internal_api/sync_manager_impl_unittest.cc',
401 'internal_api/http_bridge_unittest.cc',
408 # Unit tests for the 'sync_api' target. This cannot be a static
409 # library because the unit test files have to be compiled directly
410 # into the executable, so we push the target files to the
411 # depending executable target via direct_dependent_settings.
413 'target_name': 'sync_api_tests',
415 # We only want unit test executables to include this target.
416 'suppress_wildcard': 1,
418 '../base/base.gyp:base',
419 '../testing/gtest.gyp:gtest',
421 'test_support_sync_internal_api',
423 # Propagate all dependencies since the actual compilation
424 # happens in the dependents.
425 'export_dependent_settings': [
426 '../base/base.gyp:base',
427 '../testing/gtest.gyp:gtest',
429 'test_support_sync_internal_api',
431 'direct_dependent_settings': {
436 'api/sync_change_unittest.cc',
437 'api/sync_error_unittest.cc',
438 'api/sync_merge_result_unittest.cc',
443 # The unit test executable for sync tests.
445 'target_name': 'sync_unit_tests',
446 'type': '<(gtest_target_type)',
447 # Typed-parametrized tests generate exit-time destructors.
448 'variables': { 'enable_wexit_time_destructors': 0, },
453 '../base/base.gyp:run_all_unittests',
456 'sync_internal_api_tests',
457 'sync_notifier_tests',
460 # TODO(akalin): This is needed because histogram.cc uses
461 # leak_annotations.h, which pulls this in. Make 'base'
462 # propagate this dependency.
463 ['OS=="linux" and linux_use_tcmalloc==1', {
465 '../base/allocator/allocator.gyp:allocator',
468 ['OS == "android" and gtest_target_type == "shared_library"', {
470 '../testing/android/native_test.gyp:native_test_native_code',
476 # Test support files for using the Test Accounts service.
478 'target_name': 'test_support_accounts_client',
479 'type': 'static_library',
480 'direct_dependent_settings': {
486 '../base/base.gyp:base',
487 '../net/net.gyp:net',
490 'test/accounts_client/test_accounts_client.cc',
491 'test/accounts_client/test_accounts_client.h',
492 'test/accounts_client/url_request_context_getter.cc',
493 'test/accounts_client/url_request_context_getter.h',
497 # The Sync end-to-end (and associated infrastructure) tests.
499 'target_name': 'sync_endtoend_tests',
500 'type': '<(gtest_target_type)',
502 '../base/base.gyp:run_all_unittests',
503 '../testing/gmock.gyp:gmock',
504 '../testing/gtest.gyp:gtest',
505 '../url/url.gyp:url_lib',
506 'test_support_accounts_client',
509 'test/accounts_client/test_accounts_client_unittest.cc',
518 'target_name': 'sync_tools_helper',
519 'type': 'static_library',
521 'SYNC_IMPLEMENTATION',
527 '../base/base.gyp:base',
530 'export_dependent_settings': [
531 '../base/base.gyp:base',
535 'tools/null_invalidation_state_tracker.cc',
536 'tools/null_invalidation_state_tracker.h',
540 # A tool that can be used to launch a python sync server instance.
542 'target_name': 'run_sync_testserver',
543 'type': 'executable',
545 '../base/base.gyp:base',
546 '../base/base.gyp:test_support_base',
547 '../net/net.gyp:net_test_support',
548 '../testing/gtest.gyp:gtest',
549 'test_support_sync_testserver',
552 'tools/testserver/run_sync_testserver.cc',
556 # A tool to listen to sync notifications and print them out.
558 'target_name': 'sync_listen_notifications',
559 'type': 'executable',
564 '../base/base.gyp:base',
565 '../jingle/jingle.gyp:notifier',
566 '../net/net.gyp:net',
567 '../net/net.gyp:net_test_support',
572 'tools/sync_listen_notifications.cc',
576 # A standalone command-line sync client.
578 'target_name': 'sync_client',
579 'type': 'executable',
584 '../base/base.gyp:base',
585 '../jingle/jingle.gyp:notifier',
586 '../net/net.gyp:net',
587 '../net/net.gyp:net_test_support',
590 'test_support_sync_core'
593 'tools/sync_client.cc',
598 ['OS == "android"', {
601 'target_name': 'sync_javatests',
604 'java_in_dir': '../sync/android/javatests',
608 'sync_java_test_support',
609 '../base/base.gyp:base_java_test_support',
611 'includes': [ '../build/java.gypi' ],
614 'target_name': 'sync_java_test_support',
617 'package_name': 'sync_java_test_support',
618 'java_in_dir': '../sync/test/android/javatests',
623 'includes': [ '../build/java.gypi' ],
627 # Special target to wrap a gtest_target_type==shared_library
628 # sync_unit_tests into an android apk for execution.
629 ['OS == "android" and gtest_target_type == "shared_library"', {
632 'target_name': 'sync_unit_tests_apk',
638 'test_suite_name': 'sync_unit_tests',
639 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sync_unit_tests<(SHARED_LIB_SUFFIX)',
641 'includes': [ '../build/apk_test.gypi' ],