Fix the //sandbox/mac build when using a modern (10.7+) SDK.
[chromium-blink-merge.git] / sync / sync_tests.gypi
blob9802ce338aecf5eb4989f68d9b1d86d62874663d
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         'internal_api/public/base/model_type_test_util.cc',
31         'internal_api/public/base/model_type_test_util.h',
32         'js/js_test_util.cc',
33         'js/js_test_util.h',
34         'sessions/test_util.cc',
35         'sessions/test_util.h',
36         'test/callback_counter.h',
37         'test/engine/fake_model_worker.cc',
38         'test/engine/fake_model_worker.h',
39         'test/engine/fake_sync_scheduler.cc',
40         'test/engine/fake_sync_scheduler.h',
41         'test/engine/injectable_sync_context_proxy.cc',
42         'test/engine/injectable_sync_context_proxy.h',
43         'test/engine/mock_connection_manager.cc',
44         'test/engine/mock_connection_manager.h',
45         'test/engine/mock_model_type_sync_proxy.cc',
46         'test/engine/mock_model_type_sync_proxy.h',
47         'test/engine/mock_model_type_sync_worker.cc',
48         'test/engine/mock_model_type_sync_worker.h',
49         'test/engine/mock_nudge_handler.cc',
50         'test/engine/mock_nudge_handler.h',
51         'test/engine/mock_update_handler.cc',
52         'test/engine/mock_update_handler.h',
53         'test/engine/single_type_mock_server.cc',
54         'test/engine/single_type_mock_server.h',
55         'test/engine/test_directory_setter_upper.cc',
56         'test/engine/test_directory_setter_upper.h',
57         'test/engine/test_id_factory.h',
58         'test/engine/test_syncable_utils.cc',
59         'test/engine/test_syncable_utils.h',
60         'test/fake_encryptor.cc',
61         'test/fake_encryptor.h',
62         'test/fake_sync_encryption_handler.cc',
63         'test/fake_sync_encryption_handler.h',
64         'test/mock_invalidation.cc',
65         'test/mock_invalidation.h',
66         'test/mock_invalidation_tracker.cc',
67         'test/mock_invalidation_tracker.h',
68         'test/trackable_mock_invalidation.cc',
69         'test/trackable_mock_invalidation.h',
70         'test/null_directory_change_delegate.cc',
71         'test/null_directory_change_delegate.h',
72         'test/null_transaction_observer.cc',
73         'test/null_transaction_observer.h',
74         'test/sessions/test_scoped_session_event_listener.h',
75         'test/sessions/mock_debug_info_getter.h',
76         'test/sessions/mock_debug_info_getter.cc',
77         'test/test_directory_backing_store.cc',
78         'test/test_directory_backing_store.h',
79         'test/test_transaction_observer.cc',
80         'test/test_transaction_observer.h',
81         'util/test_unrecoverable_error_handler.cc',
82         'util/test_unrecoverable_error_handler.h',
83       ],
84     },
86     # Test support files for the python sync test server.
87     {
88       'target_name': 'test_support_sync_testserver',
89       'type': 'static_library',
90       'variables': { 'enable_wexit_time_destructors': 1, },
91       'include_dirs': [
92         '..',
93       ],
94       'dependencies': [
95         '../base/base.gyp:base',
96         '../net/net.gyp:net_test_support',
97         # The sync test server uses Python modules generated by the sync protos.
98         '../third_party/protobuf/protobuf.gyp:py_proto',
99         'sync',
100       ],
101       'export_dependent_settings': [
102         '../base/base.gyp:base',
103         '../net/net.gyp:net_test_support',
104       ],
105       'sources': [
106         'test/local_sync_test_server.cc',
107         'test/local_sync_test_server.h',
108       ],
109     },
111     # Test support files for the fake sync server.
112     {
113       'target_name': 'test_support_sync_fake_server',
114       'type': 'static_library',
115       'variables': { 'enable_wexit_time_destructors': 1, },
116       'include_dirs': [
117         '..',
118       ],
119       'dependencies': [
120         '../base/base.gyp:base',
121         '../net/net.gyp:net',
122         '../testing/gtest.gyp:gtest',
123         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
124         'sync',
125       ],
126       'export_dependent_settings': [
127         'sync',
128       ],
129       'sources': [
130         'test/fake_server/bookmark_entity.cc',
131         'test/fake_server/bookmark_entity.h',
132         'test/fake_server/bookmark_entity_builder.cc',
133         'test/fake_server/bookmark_entity_builder.h',
134         'test/fake_server/entity_builder.cc',
135         'test/fake_server/entity_builder.h',
136         'test/fake_server/entity_builder_factory.cc',
137         'test/fake_server/entity_builder_factory.h',
138         'test/fake_server/fake_server.cc',
139         'test/fake_server/fake_server.h',
140         'test/fake_server/fake_server_entity.cc',
141         'test/fake_server/fake_server_entity.h',
142         'test/fake_server/fake_server_http_post_provider.cc',
143         'test/fake_server/fake_server_http_post_provider.h',
144         'test/fake_server/fake_server_network_resources.cc',
145         'test/fake_server/fake_server_network_resources.h',
146         'test/fake_server/fake_server_verifier.cc',
147         'test/fake_server/fake_server_verifier.h',
148         'test/fake_server/permanent_entity.cc',
149         'test/fake_server/permanent_entity.h',
150         'test/fake_server/tombstone_entity.cc',
151         'test/fake_server/tombstone_entity.h',
152         'test/fake_server/unique_client_entity.cc',
153         'test/fake_server/unique_client_entity.h',
154       ],
155     },
157     # Test support files for the 'sync_internal_api' target.
158     {
159       'target_name': 'test_support_sync_internal_api',
160       'type': 'static_library',
161       'variables': { 'enable_wexit_time_destructors': 1, },
162       'include_dirs': [
163         '..',
164       ],
165       'defines': [
166         'SYNC_TEST'
167       ],
168       'dependencies': [
169         '../base/base.gyp:base',
170         '../testing/gtest.gyp:gtest',
171         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
172         'sync',
173         'test_support_sync_core',
174       ],
175       'export_dependent_settings': [
176         '../testing/gtest.gyp:gtest',
177         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
178         'sync',
179         'test_support_sync_core',
180       ],
181       'sources': [
182         'internal_api/public/base/invalidation_test_util.cc',
183         'internal_api/public/base/invalidation_test_util.h',
184         'internal_api/public/test/fake_sync_manager.h',
185         'internal_api/public/test/null_sync_context_proxy.h',
186         'internal_api/public/test/sync_manager_factory_for_profile_sync_test.h',
187         'internal_api/public/test/test_entry_factory.h',
188         'internal_api/public/test/test_internal_components_factory.h',
189         'internal_api/public/test/test_user_share.h',
190         'internal_api/test/fake_sync_manager.cc',
191         'internal_api/test/null_sync_context_proxy.cc',
192         'internal_api/test/sync_manager_factory_for_profile_sync_test.cc',
193         'internal_api/test/sync_manager_for_profile_sync_test.cc',
194         'internal_api/test/sync_manager_for_profile_sync_test.h',
195         'internal_api/test/test_entry_factory.cc',
196         'internal_api/test/test_internal_components_factory.cc',
197         'internal_api/test/test_user_share.cc',
198       ],
199     },
201     # Test support files for the 'sync_api' target.
202     {
203       'target_name': 'test_support_sync_api',
204       'type': 'static_library',
205       'include_dirs': [
206         '..',
207       ],
208       'defines': [
209         'SYNC_TEST'
210       ],
211       'dependencies': [
212         '../testing/gmock.gyp:gmock',
213         'sync',
214       ],
215       'export_dependent_settings': [
216         '../testing/gmock.gyp:gmock',
217         'sync',
218       ],
219       'sources': [
220         'api/fake_syncable_service.cc',
221         'api/fake_syncable_service.h',
222         'api/fake_sync_change_processor.cc',
223         'api/fake_sync_change_processor.h',
224         'api/sync_change_processor_wrapper_for_test.cc',
225         'api/sync_change_processor_wrapper_for_test.h',
226         'api/sync_error_factory_mock.cc',
227         'api/sync_error_factory_mock.h',
228       ],
229     },
231     # Unit tests for the 'sync_core' target.  This cannot be a static
232     # library because the unit test files have to be compiled directly
233     # into the executable, so we push the target files to the
234     # depending executable target via direct_dependent_settings.
235     {
236       'target_name': 'sync_core_tests',
237       'type': 'none',
238       # We only want unit test executables to include this target.
239       'suppress_wildcard': 1,
240       'dependencies': [
241         '../base/base.gyp:base',
242         '../sql/sql.gyp:sql',
243         '../testing/gmock.gyp:gmock',
244         '../testing/gtest.gyp:gtest',
245         'sync',
246         'test_support_sync_core',
247       ],
248       'conditions': [
249         ['OS=="linux" and chromeos==1', {
250           # Required by get_session_name_unittest.cc on Chrome OS.
251           'dependencies': [
252             '../chromeos/chromeos.gyp:chromeos',
253           ],
254         }],
255       ],
256       # Propagate all dependencies since the actual compilation
257       # happens in the dependents.
258       'export_dependent_settings': [
259         '../base/base.gyp:base',
260         '../sql/sql.gyp:sql',
261         '../testing/gmock.gyp:gmock',
262         '../testing/gtest.gyp:gtest',
263         'sync',
264         'test_support_sync_core',
265       ],
266       'direct_dependent_settings': {
267         'include_dirs': [
268           '..',
269         ],
270         'sources': [
271           'internal_api/public/base/attachment_id_proto_unittest.cc',
272           'internal_api/public/base/cancelation_signal_unittest.cc',
273           'internal_api/public/base/enum_set_unittest.cc',
274           'internal_api/public/base/node_ordinal_unittest.cc',
275           'internal_api/public/base/ordinal_unittest.cc',
276           'internal_api/public/base/unique_position_unittest.cc',
277           'internal_api/public/engine/model_safe_worker_unittest.cc',
278           'internal_api/public/util/immutable_unittest.cc',
279           'internal_api/public/util/weak_handle_unittest.cc',
280           'engine/apply_control_data_updates_unittest.cc',
281           'engine/backoff_delay_provider_unittest.cc',
282           'engine/directory_commit_contribution_unittest.cc',
283           'engine/directory_update_handler_unittest.cc',
284           'engine/entity_tracker_unittest.cc',
285           'engine/get_updates_processor_unittest.cc',
286           'engine/model_type_entity_unittest.cc',
287           'engine/model_type_sync_proxy_impl_unittest.cc',
288           'engine/model_type_sync_worker_impl_unittest.cc',
289           'engine/sync_scheduler_unittest.cc',
290           'engine/syncer_proto_util_unittest.cc',
291           'engine/syncer_unittest.cc',
292           'engine/syncer_util_unittest.cc',
293           'js/js_event_details_unittest.cc',
294           'js/sync_js_controller_unittest.cc',
295           'protocol/proto_enum_conversions_unittest.cc',
296           'protocol/proto_value_conversions_unittest.cc',
297           'sessions/model_type_registry_unittest.cc',
298           'sessions/nudge_tracker_unittest.cc',
299           'sessions/status_controller_unittest.cc',
300           'syncable/directory_unittest.cc',
301           'syncable/directory_unittest.h',
302           'syncable/directory_backing_store_unittest.cc',
303           'syncable/entry_kernel_unittest.cc',
304           'syncable/model_type_unittest.cc',
305           'syncable/nigori_util_unittest.cc',
306           'syncable/parent_child_index_unittest.cc',
307           'syncable/syncable_enum_conversions_unittest.cc',
308           'syncable/syncable_id_unittest.cc',
309           'syncable/syncable_unittest.cc',
310           'syncable/syncable_util_unittest.cc',
311           'util/cryptographer_unittest.cc',
312           'util/data_type_histogram_unittest.cc',
313           'util/get_session_name_unittest.cc',
314           'util/nigori_unittest.cc',
315           'util/protobuf_unittest.cc',
316         ],
317       },
318     },
320     # Unit tests for the 'sync_internal_api' target.  This cannot be a static
321     # library because the unit test files have to be compiled directly
322     # into the executable, so we push the target files to the
323     # depending executable target via direct_dependent_settings.
324     {
325       'target_name': 'sync_internal_api_tests',
326       'type': 'none',
327       # We only want unit test executables to include this target.
328       'suppress_wildcard': 1,
329       'dependencies': [
330         '../base/base.gyp:base',
331         '../google_apis/google_apis.gyp:google_apis',
332         '../google_apis/google_apis.gyp:google_apis_test_support',
333         '../net/net.gyp:net',
334         '../net/net.gyp:net_test_support',
335         '../testing/gmock.gyp:gmock',
336         '../testing/gtest.gyp:gtest',
337         'sync',
338         'test_support_sync_internal_api',
339       ],
340       # Propagate all dependencies since the actual compilation
341       # happens in the dependents.
342       'export_dependent_settings': [
343         '../base/base.gyp:base',
344         '../google_apis/google_apis.gyp:google_apis',
345         '../google_apis/google_apis.gyp:google_apis_test_support',
346         '../net/net.gyp:net',
347         '../net/net.gyp:net_test_support',
348         '../testing/gmock.gyp:gmock',
349         '../testing/gtest.gyp:gtest',
350         'sync',
351         'test_support_sync_internal_api',
352       ],
353       'direct_dependent_settings': {
354         'include_dirs': [
355           '..',
356         ],
357         'sources': [
358           'internal_api/attachments/attachment_downloader_impl_unittest.cc',
359           'internal_api/attachments/attachment_uploader_impl_unittest.cc',
360           'internal_api/attachments/fake_attachment_downloader_unittest.cc',
361           'internal_api/attachments/fake_attachment_store_unittest.cc',
362           'internal_api/attachments/fake_attachment_uploader_unittest.cc',
363           'internal_api/debug_info_event_listener_unittest.cc',
364           'internal_api/http_bridge_unittest.cc',
365           'internal_api/js_mutation_event_observer_unittest.cc',
366           'internal_api/js_sync_encryption_handler_observer_unittest.cc',
367           'internal_api/js_sync_manager_observer_unittest.cc',
368           'internal_api/protocol_event_buffer_unittest.cc',
369           'internal_api/public/change_record_unittest.cc',
370           'internal_api/public/sessions/sync_session_snapshot_unittest.cc',
371           'internal_api/sync_backup_manager_unittest.cc',
372           'internal_api/sync_context_proxy_impl_unittest.cc',
373           'internal_api/sync_encryption_handler_impl_unittest.cc',
374           'internal_api/sync_manager_impl_unittest.cc',
375           'internal_api/sync_rollback_manager_base_unittest.cc',
376           'internal_api/sync_rollback_manager_unittest.cc',
377           'internal_api/syncapi_server_connection_manager_unittest.cc',
378         ],
379         'conditions': [
380           ['OS == "ios"', {
381             'sources!': [
382               'internal_api/http_bridge_unittest.cc',
383             ],
384           }],
385         ],
386       },
387     },
389     # Unit tests for the 'sync_api' target.  This cannot be a static
390     # library because the unit test files have to be compiled directly
391     # into the executable, so we push the target files to the
392     # depending executable target via direct_dependent_settings.
393     {
394       'target_name': 'sync_api_tests',
395       'type': 'none',
396       # We only want unit test executables to include this target.
397       'suppress_wildcard': 1,
398       'dependencies': [
399         '../base/base.gyp:base',
400         '../testing/gtest.gyp:gtest',
401         'sync',
402         'test_support_sync_internal_api',
403       ],
404       # Propagate all dependencies since the actual compilation
405       # happens in the dependents.
406       'export_dependent_settings': [
407         '../base/base.gyp:base',
408         '../testing/gtest.gyp:gtest',
409         'sync',
410         'test_support_sync_internal_api',
411       ],
412       'direct_dependent_settings': {
413         'include_dirs': [
414           '..',
415         ],
416         'sources': [
417           'api/attachments/attachment_unittest.cc',
418           'api/attachments/attachment_id_unittest.cc',
419           'api/attachments/attachment_service_impl_unittest.cc',
420           'api/attachments/attachment_service_proxy_unittest.cc',
421           'api/sync_change_unittest.cc',
422           'api/sync_data_unittest.cc',
423           'api/sync_error_unittest.cc',
424           'api/sync_merge_result_unittest.cc',
425         ],
426       },
427     },
429     # The unit test executable for sync tests.
430     {
431       'target_name': 'sync_unit_tests',
432       'type': '<(gtest_target_type)',
433       # Typed-parametrized tests generate exit-time destructors.
434       'variables': { 'enable_wexit_time_destructors': 0, },
435       'defines': [
436         'SYNC_TEST',
437       ],
438       'dependencies': [
439         '../base/base.gyp:run_all_unittests',
440         'sync_api_tests',
441         'sync_core_tests',
442         'sync_internal_api_tests',
443         'sync',
444         '../third_party/protobuf/protobuf.gyp:protobuf_lite',
445       ],
446       'conditions': [
447         # TODO(akalin): This is needed because histogram.cc uses
448         # leak_annotations.h, which pulls this in.  Make 'base'
449         # propagate this dependency.
450         ['OS=="linux" and use_allocator!="none"', {
451           'dependencies': [
452             '../base/allocator/allocator.gyp:allocator',
453           ],
454         }],
455         ['OS == "android"', {
456           'dependencies': [
457             '../testing/android/native_test.gyp:native_test_native_code',
458           ],
459         }],
460       ],
461     },
463     # Test support files for using the Test Accounts service.
464     {
465       'target_name': 'test_support_accounts_client',
466       'type': 'static_library',
467       'direct_dependent_settings': {
468         'include_dirs': [
469           '..',
470         ],
471       },
472       'dependencies': [
473         '../base/base.gyp:base',
474         '../net/net.gyp:net',
475       ],
476       'sources': [
477         'test/accounts_client/test_accounts_client.cc',
478         'test/accounts_client/test_accounts_client.h',
479         'test/accounts_client/url_request_context_getter.cc',
480         'test/accounts_client/url_request_context_getter.h',
481       ],
482     },
484     # The Sync end-to-end (and associated infrastructure) tests.
485     {
486       'target_name': 'sync_endtoend_tests',
487       'type': '<(gtest_target_type)',
488       'dependencies': [
489         '../base/base.gyp:run_all_unittests',
490         '../testing/gmock.gyp:gmock',
491         '../testing/gtest.gyp:gtest',
492         '../url/url.gyp:url_lib',
493         'test_support_accounts_client',
494       ],
495       'sources': [
496         'test/accounts_client/test_accounts_client_unittest.cc',
497       ],
498     },
500   ],
501   'conditions': [
502     ['OS != "ios"', {
503       'targets': [
504         # A tool that can be used to launch a python sync server instance.
505         {
506           'target_name': 'run_sync_testserver',
507           'type': 'executable',
508           'dependencies': [
509             '../base/base.gyp:base',
510             '../base/base.gyp:test_support_base',
511             '../net/net.gyp:net_test_support',
512             '../testing/gtest.gyp:gtest',
513             'test_support_sync_testserver',
514           ],
515           'sources': [
516             'tools/testserver/run_sync_testserver.cc',
517           ],
518         },
519       ],
520     }],
521     ['OS == "android"', {
522       'targets': [
523         {
524           'target_name': 'sync_javatests',
525           'type': 'none',
526           'variables': {
527             'java_in_dir': '../sync/android/javatests',
528           },
529           'dependencies': [
530             'sync_java',
531             'sync_java_test_support',
532             '../base/base.gyp:base_java_test_support',
533           ],
534           'includes': [ '../build/java.gypi' ],
535         },
536         {
537           'target_name': 'sync_java_test_support',
538           'type': 'none',
539           'variables': {
540             'package_name': 'sync_java_test_support',
541             'java_in_dir': '../sync/test/android/javatests',
542           },
543           'dependencies': [
544             'sync_java',
545           ],
546           'includes': [ '../build/java.gypi' ],
547         },
548       ],
549     }],
550     ['OS == "android"', {
551       'targets': [
552         {
553           'target_name': 'sync_unit_tests_apk',
554           'type': 'none',
555           'dependencies': [
556             'sync_unit_tests',
557           ],
558           'variables': {
559             'test_suite_name': 'sync_unit_tests',
560           },
561           'includes': [ '../build/apk_test.gypi' ],
562         },
563       ],
564     }],
565   ],