Revert 215542 "[Telemetry] Add HTML output and make it the default."
[chromium-blink-merge.git] / sync / sync_tests.gypi
blob933ad7bfe1da24e2a92735f20c6dddf1ae007f4b
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.
6   'targets': [
7     # Test support files for the 'sync_core' target.
8     {
9       'target_name': 'test_support_sync_core',
10       'type': 'static_library',
11       'variables': { 'enable_wexit_time_destructors': 1, },
12       'include_dirs': [
13         '..',
14       ],
15       'defines': [
16         'SYNC_TEST'
17       ],
18       'dependencies': [
19         '../base/base.gyp:base',
20         '../testing/gmock.gyp:gmock',
21         '../testing/gtest.gyp:gtest',
22         'sync',
23       ],
24       'export_dependent_settings': [
25         '../testing/gmock.gyp:gmock',
26         '../testing/gtest.gyp:gtest',
27         'sync',
28       ],
29       'sources': [
30         'js/js_test_util.cc',
31         'js/js_test_util.h',
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/test_transaction_observer.cc',
53         'test/test_transaction_observer.h',
54         'test/null_directory_change_delegate.cc',
55         'test/null_directory_change_delegate.h',
56         'test/null_transaction_observer.cc',
57         'test/null_transaction_observer.h',
58         'test/sessions/test_scoped_session_event_listener.h',
59         'test/test_directory_backing_store.cc',
60         'test/test_directory_backing_store.h',
61         'util/test_unrecoverable_error_handler.cc',
62         'util/test_unrecoverable_error_handler.h',
63       ],
64     },
66     # Test support files for the python sync test server.
67     {
68       'target_name': 'test_support_sync_testserver',
69       'type': 'static_library',
70       'variables': { 'enable_wexit_time_destructors': 1, },
71       'include_dirs': [
72         '..',
73       ],
74       'dependencies': [
75         '../base/base.gyp:base',
76         '../net/net.gyp:net_test_support',
77         # The sync test server uses Python modules generated by the sync protos.
78         '../third_party/protobuf/protobuf.gyp:py_proto',
79         'sync',
80       ],
81       'export_dependent_settings': [
82         '../base/base.gyp:base',
83         '../net/net.gyp:net_test_support',
84       ],
85       'sources': [
86         'test/local_sync_test_server.cc',
87         'test/local_sync_test_server.h',
88       ],
89     },
91     # Test support files for the 'sync_notifier' target.
92     {
93       'target_name': 'test_support_sync_notifier',
94       'type': 'static_library',
95       'include_dirs': [
96         '..',
97       ],
98       'defines': [
99         'SYNC_TEST'
100       ],
101       'dependencies': [
102         '../testing/gmock.gyp:gmock',
103         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
104         'sync',
105       ],
106       'export_dependent_settings': [
107         '../testing/gmock.gyp:gmock',
108         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
109         'sync',
110       ],
111       'sources': [
112         'notifier/fake_invalidation_state_tracker.cc',
113         'notifier/fake_invalidation_state_tracker.h',
114         'notifier/fake_invalidator.cc',
115         'notifier/fake_invalidator.h',
116         'notifier/fake_invalidation_handler.cc',
117         'notifier/fake_invalidation_handler.h',
118         'notifier/invalidator_test_template.cc',
119         'notifier/invalidator_test_template.h',
120         'notifier/object_id_invalidation_map_test_util.cc',
121         'notifier/object_id_invalidation_map_test_util.h',
122       ],
123     },
125     # Test support files for the 'sync_internal_api' target.
126     {
127       'target_name': 'test_support_sync_internal_api',
128       'type': 'static_library',
129       'variables': { 'enable_wexit_time_destructors': 1, },
130       'include_dirs': [
131         '..',
132       ],
133       'defines': [
134         'SYNC_TEST'
135       ],
136       'dependencies': [
137         '../base/base.gyp:base',
138         '../testing/gtest.gyp:gtest',
139         'sync',
140         'test_support_sync_core',
141       ],
142       'export_dependent_settings': [
143         '../testing/gtest.gyp:gtest',
144         'sync',
145         'test_support_sync_core',
146       ],
147       'sources': [
148         'internal_api/public/base/invalidation_test_util.cc',
149         'internal_api/public/base/invalidation_test_util.h',
150         'internal_api/public/base/model_type_invalidation_map_test_util.cc',
151         'internal_api/public/base/model_type_invalidation_map_test_util.h',
152         'internal_api/public/base/model_type_test_util.cc',
153         'internal_api/public/base/model_type_test_util.h',
154         'internal_api/public/test/fake_sync_manager.h',
155         'internal_api/public/test/test_entry_factory.h',
156         'internal_api/public/test/test_internal_components_factory.h',
157         'internal_api/public/test/test_user_share.h',
158         'internal_api/test/fake_sync_manager.cc',
159         'internal_api/test/test_entry_factory.cc',
160         'internal_api/test/test_internal_components_factory.cc',
161         'internal_api/test/test_user_share.cc',
162       ],
163     },
165     # Test support files for the 'sync_api' target.
166     {
167       'target_name': 'test_support_sync_api',
168       'type': 'static_library',
169       'include_dirs': [
170         '..',
171       ],
172       'defines': [
173         'SYNC_TEST'
174       ],
175       'dependencies': [
176         '../testing/gmock.gyp:gmock',
177         'sync',
178       ],
179       'export_dependent_settings': [
180         '../testing/gmock.gyp:gmock',
181         'sync',
182       ],
183       'sources': [
184         'api/fake_syncable_service.cc',
185         'api/fake_syncable_service.h',
186         'api/sync_error_factory_mock.cc',
187         'api/sync_error_factory_mock.h',
188       ],
189     },
191     # Unit tests for the 'sync_core' target.  This cannot be a static
192     # library because the unit test files have to be compiled directly
193     # into the executable, so we push the target files to the
194     # depending executable target via direct_dependent_settings.
195     {
196       'target_name': 'sync_core_tests',
197       'type': 'none',
198       # We only want unit test executables to include this target.
199       'suppress_wildcard': 1,
200       'dependencies': [
201         '../base/base.gyp:base',
202         '../sql/sql.gyp:sql',
203         '../testing/gmock.gyp:gmock',
204         '../testing/gtest.gyp:gtest',
205         'sync',
206         'test_support_sync_core',
207       ],
208       'conditions': [
209         ['OS=="linux" and chromeos==1', {
210           # Required by get_session_name_unittest.cc on Chrome OS.
211           'dependencies': [
212             '../chromeos/chromeos.gyp:chromeos',
213           ],
214         }],
215       ],
216       # Propagate all dependencies since the actual compilation
217       # happens in the dependents.
218       'export_dependent_settings': [
219         '../base/base.gyp:base',
220         '../sql/sql.gyp:sql',
221         '../testing/gmock.gyp:gmock',
222         '../testing/gtest.gyp:gtest',
223         'sync',
224         'test_support_sync_core',
225       ],
226       'direct_dependent_settings': {
227         'include_dirs': [
228           '..',
229         ],
230         'sources': [
231           'internal_api/public/base/enum_set_unittest.cc',
232           'internal_api/public/base/model_type_invalidation_map_unittest.cc',
233           'internal_api/public/base/node_ordinal_unittest.cc',
234           'internal_api/public/base/ordinal_unittest.cc',
235           'internal_api/public/base/unique_position_unittest.cc',
236           'internal_api/public/engine/model_safe_worker_unittest.cc',
237           'internal_api/public/util/immutable_unittest.cc',
238           'internal_api/public/util/weak_handle_unittest.cc',
239           'engine/apply_control_data_updates_unittest.cc',
240           'engine/apply_updates_and_resolve_conflicts_command_unittest.cc',
241           'engine/backoff_delay_provider_unittest.cc',
242           'engine/download_unittest.cc',
243           'engine/model_changing_syncer_command_unittest.cc',
244           'engine/process_commit_response_command_unittest.cc',
245           'engine/process_updates_command_unittest.cc',
246           'engine/store_timestamps_command_unittest.cc',
247           'engine/sync_scheduler_unittest.cc',
248           'engine/syncer_proto_util_unittest.cc',
249           'engine/syncer_unittest.cc',
250           'engine/traffic_recorder_unittest.cc',
251           'js/js_arg_list_unittest.cc',
252           'js/js_event_details_unittest.cc',
253           'js/sync_js_controller_unittest.cc',
254           'protocol/proto_enum_conversions_unittest.cc',
255           'protocol/proto_value_conversions_unittest.cc',
256           'sessions/nudge_tracker_unittest.cc',
257           'sessions/ordered_commit_set_unittest.cc',
258           'sessions/status_controller_unittest.cc',
259           'sessions/sync_session_unittest.cc',
260           'syncable/directory_backing_store_unittest.cc',
261           'syncable/model_type_unittest.cc',
262           'syncable/nigori_util_unittest.cc',
263           'syncable/parent_child_index_unittest.cc',
264           'syncable/syncable_enum_conversions_unittest.cc',
265           'syncable/syncable_id_unittest.cc',
266           'syncable/syncable_unittest.cc',
267           'syncable/syncable_util_unittest.cc',
268           'util/cryptographer_unittest.cc',
269           'util/data_type_histogram_unittest.cc',
270           'util/get_session_name_unittest.cc',
271           'util/nigori_unittest.cc',
272           'util/protobuf_unittest.cc',
273         ],
274         'conditions': [
275           ['OS == "ios" and coverage != 0', {
276             'sources!': [
277               # These sources can't be built with coverage due to a toolchain
278               # bug: http://openradar.appspot.com/radar?id=1499403
279               'engine/syncer_unittest.cc',
281               # These tests crash when run with coverage turned on due to an
282               # issue with llvm_gcda_increment_indirect_counter:
283               # http://crbug.com/156058
284               'syncable/directory_backing_store_unittest.cc',
285             ],
286           }],
287         ],
288       },
289     },
291     # Unit tests for the 'sync_notifier' target.  This cannot be a static
292     # library because the unit test files have to be compiled directly
293     # into the executable, so we push the target files to the
294     # depending executable target via direct_dependent_settings.
295     {
296       'target_name': 'sync_notifier_tests',
297       'type': 'none',
298       # We only want unit test executables to include this target.
299       'suppress_wildcard': 1,
300       'dependencies': [
301         '../base/base.gyp:base',
302         '../jingle/jingle.gyp:notifier_test_util',
303         '../net/net.gyp:net_test_support',
304         '../testing/gmock.gyp:gmock',
305         '../testing/gtest.gyp:gtest',
306         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
307         '../third_party/libjingle/libjingle.gyp:libjingle',
308         'sync',
309         'test_support_sync_notifier',
310       ],
311       # Propagate all dependencies since the actual compilation
312       # happens in the dependents.
313       'export_dependent_settings': [
314         '../base/base.gyp:base',
315         '../jingle/jingle.gyp:notifier_test_util',
316         '../net/net.gyp:net_test_support',
317         '../testing/gmock.gyp:gmock',
318         '../testing/gtest.gyp:gtest',
319         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
320         '../third_party/libjingle/libjingle.gyp:libjingle',
321         'sync',
322         'test_support_sync_notifier',
323       ],
324       'direct_dependent_settings': {
325         'include_dirs': [
326           '..',
327         ],
328         'conditions': [
329           ['OS != "android"', {
330             'sources': [
331               'notifier/ack_tracker_unittest.cc',
332               'notifier/fake_invalidator_unittest.cc',
333               'notifier/invalidation_notifier_unittest.cc',
334               'notifier/invalidator_registrar_unittest.cc',
335               'notifier/non_blocking_invalidator_unittest.cc',
336               'notifier/p2p_invalidator_unittest.cc',
337               'notifier/push_client_channel_unittest.cc',
338               'notifier/registration_manager_unittest.cc',
339               'notifier/sync_invalidation_listener_unittest.cc',
340               'notifier/sync_system_resources_unittest.cc',
341             ],
342           }],
343         ],
344       },
345     },
347     # Unit tests for the 'sync_internal_api' target.  This cannot be a static
348     # library because the unit test files have to be compiled directly
349     # into the executable, so we push the target files to the
350     # depending executable target via direct_dependent_settings.
351     {
352       'target_name': 'sync_internal_api_tests',
353       'type': 'none',
354       # We only want unit test executables to include this target.
355       'suppress_wildcard': 1,
356       'dependencies': [
357         '../base/base.gyp:base',
358         '../net/net.gyp:net',
359         '../net/net.gyp:net_test_support',
360         '../testing/gmock.gyp:gmock',
361         '../testing/gtest.gyp:gtest',
362         'sync',
363         'test_support_sync_internal_api',
364       ],
365       # Propagate all dependencies since the actual compilation
366       # happens in the dependents.
367       'export_dependent_settings': [
368         '../base/base.gyp:base',
369         '../net/net.gyp:net',
370         '../net/net.gyp:net_test_support',
371         '../testing/gmock.gyp:gmock',
372         '../testing/gtest.gyp:gtest',
373         'sync',
374         'test_support_sync_internal_api',
375       ],
376       'direct_dependent_settings': {
377         'include_dirs': [
378           '..',
379         ],
380         'sources': [
381           'internal_api/debug_info_event_listener_unittest.cc',
382           'internal_api/http_bridge_unittest.cc',
383           'internal_api/js_mutation_event_observer_unittest.cc',
384           'internal_api/js_sync_encryption_handler_observer_unittest.cc',
385           'internal_api/js_sync_manager_observer_unittest.cc',
386           'internal_api/public/change_record_unittest.cc',
387           'internal_api/public/sessions/sync_session_snapshot_unittest.cc',
388           'internal_api/syncapi_server_connection_manager_unittest.cc',
389           'internal_api/sync_encryption_handler_impl_unittest.cc',
390           'internal_api/sync_manager_impl_unittest.cc',
391         ],
392         'conditions': [
393           ['OS == "ios"', {
394             'sources!': [
395               'internal_api/http_bridge_unittest.cc',
396             ],
397           }],
398         ],
399       },
400     },
402     # Unit tests for the 'sync_api' target.  This cannot be a static
403     # library because the unit test files have to be compiled directly
404     # into the executable, so we push the target files to the
405     # depending executable target via direct_dependent_settings.
406     {
407       'target_name': 'sync_api_tests',
408       'type': 'none',
409       # We only want unit test executables to include this target.
410       'suppress_wildcard': 1,
411       'dependencies': [
412         '../base/base.gyp:base',
413         '../testing/gtest.gyp:gtest',
414         'sync',
415         'test_support_sync_internal_api',
416       ],
417       # Propagate all dependencies since the actual compilation
418       # happens in the dependents.
419       'export_dependent_settings': [
420         '../base/base.gyp:base',
421         '../testing/gtest.gyp:gtest',
422         'sync',
423         'test_support_sync_internal_api',
424       ],
425       'direct_dependent_settings': {
426         'include_dirs': [
427           '..',
428         ],
429         'sources': [
430           'api/sync_change_unittest.cc',
431           'api/sync_error_unittest.cc',
432           'api/sync_merge_result_unittest.cc',
433         ],
434       },
435     },
437     # The unit test executable for sync tests.
438     {
439       'target_name': 'sync_unit_tests',
440       'type': '<(gtest_target_type)',
441       # Typed-parametrized tests generate exit-time destructors.
442       'variables': { 'enable_wexit_time_destructors': 0, },
443       'defines': [
444         'SYNC_TEST',
445       ],
446       'dependencies': [
447         '../base/base.gyp:run_all_unittests',
448         'sync_api_tests',
449         'sync_core_tests',
450         'sync_internal_api_tests',
451         'sync_notifier_tests',
452       ],
453       'conditions': [
454         # TODO(akalin): This is needed because histogram.cc uses
455         # leak_annotations.h, which pulls this in.  Make 'base'
456         # propagate this dependency.
457         ['OS=="linux" and linux_use_tcmalloc==1', {
458           'dependencies': [
459             '../base/allocator/allocator.gyp:allocator',
460           ],
461         }],
462         ['OS == "android" and gtest_target_type == "shared_library"', {
463           'dependencies': [
464             '../testing/android/native_test.gyp:native_test_native_code',
465           ],
466         }],
467       ],
468     },
470     # Test support files for using the Test Accounts service.
471     {
472       'target_name': 'test_support_accounts_client',
473       'type': 'static_library',
474       'direct_dependent_settings': {
475         'include_dirs': [
476           '..',
477         ],
478       },
479       'dependencies': [
480         '../base/base.gyp:base',
481         '../net/net.gyp:net',
482       ],
483       'sources': [
484         'test/accounts_client/test_accounts_client.cc',
485         'test/accounts_client/test_accounts_client.h',
486         'test/accounts_client/url_request_context_getter.cc',
487         'test/accounts_client/url_request_context_getter.h',
488       ],
489     },
491     # The Sync end-to-end (and associated infrastructure) tests.
492     {
493       'target_name': 'sync_endtoend_tests',
494       'type': '<(gtest_target_type)',
495       'dependencies': [
496         '../base/base.gyp:run_all_unittests',
497         '../testing/gmock.gyp:gmock',
498         '../testing/gtest.gyp:gtest',
499         '../url/url.gyp:url_lib',
500         'test_support_accounts_client',
501       ],
502       'sources': [
503         'test/accounts_client/test_accounts_client_unittest.cc',
504       ],
505     },
507   ],
508   'conditions': [
509     ['OS != "ios"', {
510       'targets': [
511         {
512           'target_name': 'sync_tools_helper',
513           'type': 'static_library',
514           'defines': [
515             'SYNC_IMPLEMENTATION',
516           ],
517           'include_dirs': [
518             '..',
519           ],
520           'dependencies': [
521             '../base/base.gyp:base',
522             'sync',
523           ],
524           'export_dependent_settings': [
525             '../base/base.gyp:base',
526             'sync',
527           ],
528           'sources': [
529             'tools/null_invalidation_state_tracker.cc',
530             'tools/null_invalidation_state_tracker.h',
531           ],
532         },
534         # A tool that can be used to launch a python sync server instance.
535         {
536           'target_name': 'run_sync_testserver',
537           'type': 'executable',
538           'dependencies': [
539             '../base/base.gyp:base',
540             '../base/base.gyp:test_support_base',
541             '../net/net.gyp:net_test_support',
542             '../testing/gtest.gyp:gtest',
543             'test_support_sync_testserver',
544           ],
545           'sources': [
546             'tools/testserver/run_sync_testserver.cc',
547           ],
548         },
550         # A tool to listen to sync notifications and print them out.
551         {
552           'target_name': 'sync_listen_notifications',
553           'type': 'executable',
554           'defines': [
555             'SYNC_TEST',
556           ],
557           'dependencies': [
558             '../base/base.gyp:base',
559             '../jingle/jingle.gyp:notifier',
560             '../net/net.gyp:net',
561             '../net/net.gyp:net_test_support',
562             'sync',
563             'sync_tools_helper',
564           ],
565           'sources': [
566             'tools/sync_listen_notifications.cc',
567           ],
568         },
570         # A standalone command-line sync client.
571         {
572           'target_name': 'sync_client',
573           'type': 'executable',
574           'defines': [
575             'SYNC_TEST',
576           ],
577           'dependencies': [
578             '../base/base.gyp:base',
579             '../jingle/jingle.gyp:notifier',
580             '../net/net.gyp:net',
581             '../net/net.gyp:net_test_support',
582             'sync',
583             'sync_tools_helper',
584             'test_support_sync_core'
585           ],
586           'sources': [
587             'tools/sync_client.cc',
588           ],
589         },
590       ],
591     }],
592     ['OS == "android"', {
593       'targets': [
594         {
595           'target_name': 'sync_javatests',
596           'type': 'none',
597           'variables': {
598             'java_in_dir': '../sync/android/javatests',
599           },
600           'dependencies': [
601             'sync_java',
602             'sync_java_test_support',
603             '../base/base.gyp:base_java_test_support',
604           ],
605           'includes': [ '../build/java.gypi' ],
606         },
607         {
608           'target_name': 'sync_java_test_support',
609           'type': 'none',
610           'variables': {
611             'package_name': 'sync_java_test_support',
612             'java_in_dir': '../sync/test/android/javatests',
613           },
614           'dependencies': [
615             'sync_java',
616           ],
617           'includes': [ '../build/java.gypi' ],
618         },
619       ],
620     }],
621     # Special target to wrap a gtest_target_type==shared_library
622     # sync_unit_tests into an android apk for execution.
623     ['OS == "android" and gtest_target_type == "shared_library"', {
624       'targets': [
625         {
626           'target_name': 'sync_unit_tests_apk',
627           'type': 'none',
628           'dependencies': [
629             'sync_unit_tests',
630           ],
631           'variables': {
632             'test_suite_name': 'sync_unit_tests',
633             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sync_unit_tests<(SHARED_LIB_SUFFIX)',
634           },
635           'includes': [ '../build/apk_test.gypi' ],
636         },
637       ],
638     }],
639   ],