summaryrefslogtreecommitdiffstats
path: root/device/device_tests.gyp
blob: e477b11214b177a2d65626b30d80ed8445a85547 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'variables': {
    'chromium_code': 1,
  },
  'targets': [
    {
      'target_name': 'device_unittests',
      'type': '<(gtest_target_type)',
      'dependencies': [
        '../base/base.gyp:test_support_base',
        '../mojo/mojo_base.gyp:mojo_url_type_converters',
        '../mojo/mojo_edk.gyp:mojo_system_impl',
        '../mojo/mojo_public.gyp:mojo_cpp_bindings',
        '../testing/gmock.gyp:gmock',
        '../testing/gtest.gyp:gtest',
        '../tools/usb_gadget/usb_gadget.gyp:usb_gadget',
        'battery/battery.gyp:device_battery',
        'battery/battery.gyp:device_battery_mojo_bindings',
        'bluetooth/bluetooth.gyp:device_bluetooth',
        'bluetooth/bluetooth.gyp:device_bluetooth_mocks',
        'core/core.gyp:device_core',
        'core/core.gyp:device_core_mocks',
        'nfc/nfc.gyp:device_nfc',
        'usb/usb.gyp:device_usb',
        'usb/usb.gyp:device_usb_mocks',
        'usb/usb.gyp:device_usb_mojo_bindings',
        'hid/hid.gyp:device_hid',
        'hid/hid.gyp:device_hid_mocks',
        'serial/serial.gyp:device_serial',
        'serial/serial.gyp:device_serial_test_util',
      ],
      'sources': [
        'battery/battery_status_manager_linux_unittest.cc',
        'battery/battery_status_manager_win_unittest.cc',
        'battery/battery_status_service_unittest.cc',
        'bluetooth/bluetooth_adapter_mac_unittest.mm',
        'bluetooth/bluetooth_adapter_unittest.cc',
        'bluetooth/bluetooth_adapter_win_unittest.cc',
        'bluetooth/bluetooth_advertisement_unittest.cc',
        'bluetooth/bluetooth_device_unittest.cc',
        'bluetooth/bluetooth_device_win_unittest.cc',
        'bluetooth/bluetooth_discovery_filter_unittest.cc',
        'bluetooth/bluetooth_gatt_characteristic_unittest.cc',
        'bluetooth/bluetooth_gatt_descriptor_unittest.cc',
        'bluetooth/bluetooth_gatt_service_unittest.cc',
        'bluetooth/bluetooth_low_energy_win_unittest.cc',
        'bluetooth/bluetooth_service_record_win_unittest.cc',
        'bluetooth/bluetooth_task_manager_win_unittest.cc',
        'bluetooth/bluetooth_uuid_unittest.cc',
        'bluetooth/test/bluetooth_test.cc',
        'bluetooth/test/bluetooth_test.h',
        'bluetooth/test/bluetooth_test_android.cc',
        'bluetooth/test/bluetooth_test_android.h',
        'bluetooth/test/bluetooth_test_mac.h',
        'bluetooth/test/bluetooth_test_mac.mm',
        'bluetooth/test/bluetooth_test_win.h',
        'bluetooth/test/bluetooth_test_win.cc',
        'bluetooth/test/mock_bluetooth_cbperipheral_mac.mm',
        'bluetooth/test/mock_bluetooth_cbperipheral_mac.h',
        'bluetooth/test/mock_bluetooth_central_manager_mac.mm',
        'bluetooth/test/mock_bluetooth_central_manager_mac.h',
        'bluetooth/test/test_bluetooth_adapter_observer.cc',
        'bluetooth/test/test_bluetooth_adapter_observer.h',
        'hid/hid_connection_unittest.cc',
        'hid/hid_device_filter_unittest.cc',
        'hid/hid_report_descriptor_unittest.cc',
        'hid/input_service_linux_unittest.cc',
        'hid/test_report_descriptors.cc',
        'hid/test_report_descriptors.h',
        'nfc/nfc_chromeos_unittest.cc',
        'nfc/nfc_ndef_record_unittest.cc',
        'serial/data_sink_unittest.cc',
        'serial/data_source_unittest.cc',
        'serial/serial_connection_unittest.cc',
        "serial/serial_io_handler_posix_unittest.cc",
        'serial/serial_service_unittest.cc',
        'test/run_all_unittests.cc',
        'test/test_device_client.cc',
        'test/test_device_client.h',
        'test/usb_test_gadget_impl.cc',
        'usb/mojo/device_impl_unittest.cc',
        'usb/mojo/device_manager_impl_unittest.cc',
        'usb/mojo/fake_permission_provider.cc',
        'usb/mojo/fake_permission_provider.h',
        'usb/usb_descriptors_unittest.cc',
        'usb/usb_device_filter_unittest.cc',
        'usb/usb_device_handle_unittest.cc',
        'usb/usb_ids_unittest.cc',
        'usb/usb_service_unittest.cc',
        'usb/webusb_descriptors_unittest.cc',
      ],
      'conditions': [
        ['chromeos==1', {
          'dependencies': [
            '../chromeos/chromeos.gyp:chromeos_test_support',
            '../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
          ],
          'sources!': [
            'battery/battery_status_manager_linux_unittest.cc',
          ],
        }],
        ['(chromeos==1 or OS=="linux") and use_dbus==1', {
          'dependencies': [
            '../build/linux/system.gyp:dbus',
            '../dbus/dbus.gyp:dbus',
          ],
          'sources': [
            'bluetooth/bluetooth_adapter_profile_bluez_unittest.cc',
            'bluetooth/bluetooth_advertisement_bluez_unittest.cc',
            'bluetooth/bluetooth_audio_sink_bluez_unittest.cc',
            'bluetooth/bluetooth_bluez_unittest.cc',
            'bluetooth/bluetooth_gatt_bluez_unittest.cc',
            'bluetooth/bluetooth_socket_bluez_unittest.cc',
          ],
        }],
        ['OS=="android"', {
          'dependencies!': [
            'battery/battery.gyp:device_battery',
            'serial/serial.gyp:device_serial',
            'serial/serial.gyp:device_serial_test_util',
            'hid/hid.gyp:device_hid',
          ],
          'dependencies': [
            '../testing/android/native_test.gyp:native_test_native_code',
            'device_bluetooth_test_java',
            'device_bluetooth_test_jni_headers',
          ],
          'sources/': [
            ['exclude', '(^|/)hid'],
            ['exclude', '(^|/)serial'],
          ],
          'sources!': [
            'battery/battery_status_service_unittest.cc',
            'usb/usb_context_unittest.cc',
          ],
        }],
        ['OS=="mac"', {
          'dependencies': [
            '../third_party/ocmock/ocmock.gyp:ocmock',
          ],
          'link_settings': {
            'libraries': [
              '$(SDKROOT)/System/Library/Frameworks/IOBluetooth.framework',
            ],
          },
          'xcode_settings' : {
            'OTHER_LDFLAGS' : [
              '-ObjC',
            ],
          },
        }],
        ['use_udev==1', {
          'dependencies': [
            'udev_linux/udev.gyp:udev_linux',
          ],
          'sources': [
            'udev_linux/udev_unittest.cc',
          ],
        }],
        ['OS=="linux" and use_udev==0', {
          # Udev is the only Linux implementation. If we're compiling without
          # Udev, disable these unittests.
          'dependencies!': [
            'hid/hid.gyp:device_hid',
            'serial/serial.gyp:device_serial',
            'serial/serial.gyp:device_serial_test_util',
          ],
          'sources/': [
            ['exclude', '^serial/'],
            ['exclude', '^hid/'],
          ],
        }],
        ['use_dbus==0', {
          'sources!': [
            'battery/battery_status_manager_linux_unittest.cc',
          ],
        }],
        ['OS=="win"', {
          'sources': [
            'bluetooth/bluetooth_classic_win_fake.cc',
            'bluetooth/bluetooth_classic_win_fake.h',
            'bluetooth/bluetooth_low_energy_win_fake.h',
            'bluetooth/bluetooth_low_energy_win_fake.cc',
          ],
        }],
      ],
    },
  ],
  'conditions': [
    ['OS=="android"', {
      'targets': [
        {
          'target_name': 'device_unittests_apk',
          'type': 'none',
          'dependencies': [
            'device_unittests',
          ],
          'variables': {
            'test_suite_name': 'device_unittests',
          },
          'includes': [ '../build/apk_test.gypi' ],
        },
        {
          'target_name': 'device_bluetooth_test_jni_headers',
          'type': 'none',
          'sources': [
            'bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java',
          ],
          'variables': {
            'jni_gen_package': 'device_bluetooth',
          },
          'includes': [ '../build/jni_generator.gypi' ],
        },
        {
          'target_name': 'device_bluetooth_test_java',
          'type': 'none',
          'dependencies': [
            'bluetooth/bluetooth.gyp:device_bluetooth_java',
          ],
          'variables': {
            'java_in_dir': 'bluetooth/test/android/java',
          },
          'includes': [ '../build/java.gypi' ],
        },
      ],
      'conditions': [
        ['test_isolation_mode != "noop"', {
          'targets': [
            {
              'target_name': 'device_unittests_apk_run',
              'type': 'none',
              'dependencies': [
                'device_unittests_apk',
              ],
              'includes': [
                '../build/isolate.gypi',
              ],
              'sources': [
                'device_unittests_apk.isolate',
              ],
            },
          ],
        }],
      ],
    }],
    ['test_isolation_mode != "noop"', {
      'targets': [
        {
          'target_name': 'device_unittests_run',
          'type': 'none',
          'dependencies': [
            'device_unittests',
          ],
          'includes': [
            '../build/isolate.gypi',
          ],
          'sources': [
            'device_unittests.isolate',
          ]
        }
      ]
    }]
  ],
}