Fix various build failures in the chimera build.
[chromium-blink-merge.git] / device / device_tests.gyp
blob66ce52929b99f7768f7e7b478e656092c4115315
1 # Copyright (c) 2012 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   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       'target_name': 'device_unittests',
12       'type': '<(gtest_target_type)',
13       'dependencies': [
14         '../base/base.gyp:test_support_base',
15         '../mojo/mojo_base.gyp:mojo_environment_chromium',
16         '../testing/gmock.gyp:gmock',
17         '../testing/gtest.gyp:gtest',
18         '../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
19         '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
20         '../tools/usb_gadget/usb_gadget.gyp:usb_gadget',
21         'battery/battery.gyp:device_battery',
22         'battery/battery.gyp:device_battery_mojo_bindings',
23         'bluetooth/bluetooth.gyp:device_bluetooth',
24         'bluetooth/bluetooth.gyp:device_bluetooth_mocks',
25         'core/core.gyp:device_core',
26         'devices_app/devices_app.gyp:devices_app_lib',
27         'nfc/nfc.gyp:device_nfc',
28         'usb/usb.gyp:device_usb',
29         'usb/usb.gyp:device_usb_mocks',
30         'hid/hid.gyp:device_hid',
31         'serial/serial.gyp:device_serial',
32         'serial/serial.gyp:device_serial_test_util',
33       ],
34       'sources': [
35         'battery/battery_status_manager_linux_unittest.cc',
36         'battery/battery_status_manager_win_unittest.cc',
37         'battery/battery_status_service_unittest.cc',
38         'bluetooth/bluetooth_adapter_mac_unittest.mm',
39         'bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc',
40         'bluetooth/bluetooth_adapter_unittest.cc',
41         'bluetooth/bluetooth_adapter_win_unittest.cc',
42         'bluetooth/bluetooth_advertisement_chromeos_unittest.cc',
43         'bluetooth/bluetooth_audio_sink_chromeos_unittest.cc',
44         'bluetooth/bluetooth_chromeos_unittest.cc',
45         'bluetooth/bluetooth_device_unittest.cc',
46         'bluetooth/bluetooth_device_win_unittest.cc',
47         'bluetooth/bluetooth_discovery_filter_unittest.cc',
48         'bluetooth/bluetooth_gatt_chromeos_unittest.cc',
49         'bluetooth/bluetooth_low_energy_win_unittest.cc',
50         'bluetooth/bluetooth_service_record_win_unittest.cc',
51         'bluetooth/bluetooth_socket_chromeos_unittest.cc',
52         'bluetooth/bluetooth_task_manager_win_unittest.cc',
53         'bluetooth/bluetooth_uuid_unittest.cc',
54         'bluetooth/test/bluetooth_test.cc',
55         'bluetooth/test/bluetooth_test.h',
56         'bluetooth/test/bluetooth_test_android.cc',
57         'bluetooth/test/bluetooth_test_android.h',
58         'bluetooth/test/test_bluetooth_adapter_observer.cc',
59         'bluetooth/test/test_bluetooth_adapter_observer.h',
60         'devices_app/usb/device_impl_unittest.cc',
61         'devices_app/usb/device_manager_impl_unittest.cc',
62         'hid/hid_connection_unittest.cc',
63         'hid/hid_device_filter_unittest.cc',
64         'hid/hid_report_descriptor_unittest.cc',
65         'hid/input_service_linux_unittest.cc',
66         'hid/test_report_descriptors.cc',
67         'hid/test_report_descriptors.h',
68         'nfc/nfc_chromeos_unittest.cc',
69         'nfc/nfc_ndef_record_unittest.cc',
70         'serial/data_sink_unittest.cc',
71         'serial/data_source_unittest.cc',
72         'serial/serial_connection_unittest.cc',
73         'serial/serial_service_unittest.cc',
74         'test/run_all_unittests.cc',
75         'test/usb_test_gadget_impl.cc',
76         'usb/usb_context_unittest.cc',
77         'usb/usb_device_filter_unittest.cc',
78         'usb/usb_device_handle_unittest.cc',
79         'usb/usb_ids_unittest.cc',
80         'usb/usb_service_unittest.cc',
81       ],
82       'conditions': [
83         ['chromeos==1', {
84           'dependencies': [
85             '../build/linux/system.gyp:dbus',
86             '../chromeos/chromeos.gyp:chromeos_test_support',
87             '../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
88             '../dbus/dbus.gyp:dbus',
89           ],
90           'sources!': [
91             'battery/battery_status_manager_linux_unittest.cc',
92           ],
93         }],
94         ['OS=="android"', {
95           'dependencies!': [
96             '../tools/usb_gadget/usb_gadget.gyp:usb_gadget',
97             'devices_app/devices_app.gyp:devices_app_lib',
98             'usb/usb.gyp:device_usb',
99             'usb/usb.gyp:device_usb_mocks',
100             'serial/serial.gyp:device_serial',
101             'serial/serial.gyp:device_serial_test_util',
102             'hid/hid.gyp:device_hid',
103           ],
104           'dependencies': [
105             '../testing/android/native_test.gyp:native_test_native_code',
106             'device_bluetooth_test_java',
107             'device_bluetooth_test_jni_headers',
108           ],
109           'sources/': [
110             ['exclude', '(^|/)hid'],
111             ['exclude', '(^|/)serial'],
112             ['exclude', '(^|/)usb'],
113           ],
114         }],
115         ['OS=="mac"', {
116           'link_settings': {
117             'libraries': [
118               '$(SDKROOT)/System/Library/Frameworks/IOBluetooth.framework',
119             ],
120           },
121         }],
122         ['os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
123           'conditions': [
124             ['use_allocator!="none"', {
125               'dependencies': [
126                 '../base/allocator/allocator.gyp:allocator',
127               ],
128             }],
129           ],
130         }],
131         ['use_udev==1', {
132           'dependencies': [
133             'udev_linux/udev.gyp:udev_linux',
134           ],
135           'sources': [
136             'udev_linux/udev_unittest.cc',
137           ],
138         }],
139         ['OS=="linux" and use_udev==0', {
140           # Udev is the only Linux implementation. If we're compiling without
141           # Udev, disable these unittests.
142           'dependencies!': [
143             'hid/hid.gyp:device_hid',
144             'serial/serial.gyp:device_serial',
145             'serial/serial.gyp:device_serial_test_util',
146           ],
147           'sources/': [
148             ['exclude', '^serial/'],
149             ['exclude', '^hid/'],
150           ],
151         }],
152         ['use_dbus==0', {
153           'sources!': [
154             'battery/battery_status_manager_linux_unittest.cc',
155           ],
156         }],
157       ],
158     },
159   ],
160   'conditions': [
161     ['OS=="android"', {
162       'targets': [
163         {
164           'target_name': 'device_unittests_apk',
165           'type': 'none',
166           'dependencies': [
167             'device_unittests',
168           ],
169           'variables': {
170             'test_suite_name': 'device_unittests',
171           },
172           'includes': [ '../build/apk_test.gypi' ],
173         },
174         {
175           'target_name': 'device_bluetooth_test_jni_headers',
176           'type': 'none',
177           'sources': [
178             'bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java',
179           ],
180           'variables': {
181             'jni_gen_package': 'device_bluetooth',
182           },
183           'includes': [ '../build/jni_generator.gypi' ],
184         },
185         {
186           'target_name': 'device_bluetooth_test_java',
187           'type': 'none',
188           'dependencies': [
189             'bluetooth/bluetooth.gyp:device_bluetooth_java',
190           ],
191           'variables': {
192             'java_in_dir': 'bluetooth/test/android/java',
193           },
194           'includes': [ '../build/java.gypi' ],
195         },
196       ],
197     }],
198     ['test_isolation_mode != "noop"', {
199       'targets': [
200         {
201           'target_name': 'device_unittests_run',
202           'type': 'none',
203           'dependencies': [
204             'device_unittests',
205           ],
206           'includes': [
207             '../build/isolate.gypi',
208           ],
209           'sources': [
210             'device_unittests.isolate',
211           ]
212         }
213       ]
214     }]
215   ],