| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
| 6 import("//testing/test.gni") | 6 import("//testing/test.gni") |
| 7 | 7 |
| 8 is_linux_without_udev = is_linux && !use_udev |
| 9 is_linux_without_dbus = is_linux && !use_dbus |
| 10 |
| 8 test("device_unittests") { | 11 test("device_unittests") { |
| 9 sources = [ | 12 sources = [ |
| 10 "battery/battery_status_manager_linux_unittest.cc", | |
| 11 "battery/battery_status_manager_win_unittest.cc", | 13 "battery/battery_status_manager_win_unittest.cc", |
| 12 "battery/battery_status_service_unittest.cc", | 14 "battery/battery_status_service_unittest.cc", |
| 13 "bluetooth/bluetooth_adapter_mac_unittest.mm", | 15 "bluetooth/bluetooth_adapter_mac_unittest.mm", |
| 14 "bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc", | 16 "bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc", |
| 15 "bluetooth/bluetooth_adapter_unittest.cc", | 17 "bluetooth/bluetooth_adapter_unittest.cc", |
| 16 "bluetooth/bluetooth_adapter_win_unittest.cc", | 18 "bluetooth/bluetooth_adapter_win_unittest.cc", |
| 17 "bluetooth/bluetooth_audio_sink_chromeos_unittest.cc", | 19 "bluetooth/bluetooth_audio_sink_chromeos_unittest.cc", |
| 18 "bluetooth/bluetooth_chromeos_unittest.cc", | 20 "bluetooth/bluetooth_chromeos_unittest.cc", |
| 19 "bluetooth/bluetooth_device_unittest.cc", | 21 "bluetooth/bluetooth_device_unittest.cc", |
| 20 "bluetooth/bluetooth_device_win_unittest.cc", | 22 "bluetooth/bluetooth_device_win_unittest.cc", |
| 21 "bluetooth/bluetooth_gatt_chromeos_unittest.cc", | 23 "bluetooth/bluetooth_gatt_chromeos_unittest.cc", |
| 22 "bluetooth/bluetooth_low_energy_win_unittest.cc", | 24 "bluetooth/bluetooth_low_energy_win_unittest.cc", |
| 23 "bluetooth/bluetooth_service_record_win_unittest.cc", | 25 "bluetooth/bluetooth_service_record_win_unittest.cc", |
| 24 "bluetooth/bluetooth_socket_chromeos_unittest.cc", | 26 "bluetooth/bluetooth_socket_chromeos_unittest.cc", |
| 25 "bluetooth/bluetooth_task_manager_win_unittest.cc", | 27 "bluetooth/bluetooth_task_manager_win_unittest.cc", |
| 26 "bluetooth/bluetooth_uuid_unittest.cc", | 28 "bluetooth/bluetooth_uuid_unittest.cc", |
| 27 "hid/hid_connection_unittest.cc", | |
| 28 "hid/hid_device_filter_unittest.cc", | |
| 29 "hid/hid_report_descriptor_unittest.cc", | |
| 30 "hid/input_service_linux_unittest.cc", | |
| 31 "hid/test_report_descriptors.cc", | |
| 32 "hid/test_report_descriptors.h", | |
| 33 "nfc/nfc_chromeos_unittest.cc", | 29 "nfc/nfc_chromeos_unittest.cc", |
| 34 "nfc/nfc_ndef_record_unittest.cc", | 30 "nfc/nfc_ndef_record_unittest.cc", |
| 35 "serial/data_sink_unittest.cc", | |
| 36 "serial/data_source_unittest.cc", | |
| 37 "serial/serial_connection_unittest.cc", | |
| 38 "serial/serial_service_unittest.cc", | |
| 39 "test/run_all_unittests.cc", | 31 "test/run_all_unittests.cc", |
| 40 "test/usb_test_gadget_impl.cc", | 32 "test/usb_test_gadget_impl.cc", |
| 41 "usb/usb_context_unittest.cc", | 33 "usb/usb_context_unittest.cc", |
| 42 "usb/usb_device_filter_unittest.cc", | 34 "usb/usb_device_filter_unittest.cc", |
| 43 "usb/usb_device_handle_unittest.cc", | 35 "usb/usb_device_handle_unittest.cc", |
| 44 "usb/usb_ids_unittest.cc", | 36 "usb/usb_ids_unittest.cc", |
| 45 "usb/usb_service_unittest.cc", | 37 "usb/usb_service_unittest.cc", |
| 46 ] | 38 ] |
| 47 | 39 |
| 48 deps = [ | 40 deps = [ |
| 49 "//base/test:test_support", | 41 "//base/test:test_support", |
| 50 "//device/battery", | 42 "//device/battery", |
| 51 "//device/battery:mojo_bindings", | 43 "//device/battery:mojo_bindings", |
| 52 "//device/bluetooth", | 44 "//device/bluetooth", |
| 53 "//device/hid", | |
| 54 "//device/nfc", | 45 "//device/nfc", |
| 55 "//device/serial", | |
| 56 "//device/serial:test_support", | |
| 57 "//device/usb", | 46 "//device/usb", |
| 58 "//mojo/environment:chromium", | 47 "//mojo/environment:chromium", |
| 59 "//net", | 48 "//net", |
| 60 "//testing/gmock", | 49 "//testing/gmock", |
| 61 "//testing/gtest", | 50 "//testing/gtest", |
| 62 "//third_party/libusb", | 51 "//third_party/libusb", |
| 63 "//third_party/mojo/src/mojo/edk/system", | 52 "//third_party/mojo/src/mojo/edk/system", |
| 64 "//third_party/mojo/src/mojo/public/cpp/bindings", | 53 "//third_party/mojo/src/mojo/public/cpp/bindings", |
| 65 "//url", | 54 "//url", |
| 66 ] | 55 ] |
| 67 | 56 |
| 68 if (is_chromeos) { | 57 if (!is_linux_without_dbus && !is_chromeos) { |
| 69 sources -= [ "battery/battery_status_manager_linux_unittest.cc" ] | 58 sources += [ "battery/battery_status_manager_linux_unittest.cc" ] |
| 70 | |
| 71 configs += [ "//build/config/linux:dbus" ] | |
| 72 | |
| 73 deps += [ | |
| 74 "//chromeos", | |
| 75 "//chromeos:test_support", | |
| 76 "//chromeos:test_support_without_gmock", | |
| 77 "//dbus", | |
| 78 ] | |
| 79 } | 59 } |
| 80 | 60 |
| 81 if (is_posix && !is_mac) { | 61 # HID and Serial: |
| 82 libs = [ "rt" ] | 62 # Linux, requires udev. |
| 83 } | 63 if (!is_linux_without_udev) { |
| 84 | 64 sources += [ |
| 85 if (is_mac) { | |
| 86 libs = [ "IOBluetooth.framework" ] | |
| 87 } | |
| 88 | |
| 89 if (use_udev) { | |
| 90 sources += [ "udev_linux/udev_unittest.cc" ] | |
| 91 | |
| 92 deps += [ "//device/udev_linux" ] | |
| 93 } | |
| 94 | |
| 95 if (is_linux && !use_udev) { | |
| 96 # Udev is the only Linux implementation. If we're compiling without Udev, | |
| 97 # disable these unittests. | |
| 98 sources -= [ | |
| 99 "hid/hid_connection_unittest.cc", | 65 "hid/hid_connection_unittest.cc", |
| 100 "hid/hid_device_filter_unittest.cc", | 66 "hid/hid_device_filter_unittest.cc", |
| 101 "hid/hid_report_descriptor_unittest.cc", | 67 "hid/hid_report_descriptor_unittest.cc", |
| 102 "hid/input_service_linux_unittest.cc", | 68 "hid/input_service_linux_unittest.cc", |
| 103 "hid/test_report_descriptors.cc", | 69 "hid/test_report_descriptors.cc", |
| 104 "hid/test_report_descriptors.h", | 70 "hid/test_report_descriptors.h", |
| 105 "serial/data_sink_unittest.cc", | 71 "serial/data_sink_unittest.cc", |
| 106 "serial/data_source_unittest.cc", | 72 "serial/data_source_unittest.cc", |
| 107 "serial/serial_connection_unittest.cc", | 73 "serial/serial_connection_unittest.cc", |
| 108 "serial/serial_service_unittest.cc", | 74 "serial/serial_service_unittest.cc", |
| 109 ] | 75 ] |
| 110 | 76 deps += [ |
| 111 deps -= [ | |
| 112 "//device/hid", | 77 "//device/hid", |
| 113 "//device/serial", | 78 "//device/serial", |
| 114 "//device/serial:test_support", | 79 "//device/serial:test_support", |
| 115 ] | 80 ] |
| 116 } | 81 } |
| 117 | 82 |
| 118 if (is_linux && !use_dbus) { | 83 if (use_udev) { |
| 119 sources -= [ "battery/battery_status_manager_linux_unittest.cc" ] | 84 sources += [ "udev_linux/udev_unittest.cc" ] |
| 85 deps += [ "//device/udev_linux" ] |
| 86 } |
| 87 |
| 88 if (is_chromeos) { |
| 89 configs += [ "//build/config/linux:dbus" ] |
| 90 |
| 91 deps += [ |
| 92 "//chromeos", |
| 93 "//chromeos:test_support", |
| 94 "//chromeos:test_support_without_gmock", |
| 95 "//dbus", |
| 96 ] |
| 97 } |
| 98 |
| 99 if (is_posix && !is_mac) { |
| 100 libs = [ "rt" ] |
| 101 } |
| 102 |
| 103 if (is_mac) { |
| 104 libs = [ "IOBluetooth.framework" ] |
| 120 } | 105 } |
| 121 } | 106 } |
| OLD | NEW |