1# Copyright 2014 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. 4 5import("//third_party/protobuf/proto_library.gni") 6 7component("dbus") { 8 sources = [ 9 "bus.cc", 10 "bus.h", 11 "dbus_export.h", 12 "dbus_statistics.cc", 13 "dbus_statistics.h", 14 "exported_object.cc", 15 "exported_object.h", 16 "file_descriptor.cc", 17 "file_descriptor.h", 18 "message.cc", 19 "message.h", 20 "object_manager.cc", 21 "object_manager.h", 22 "object_path.cc", 23 "object_path.h", 24 "object_proxy.cc", 25 "object_proxy.h", 26 "property.cc", 27 "property.h", 28 "scoped_dbus_error.cc", 29 "scoped_dbus_error.h", 30 "string_util.cc", 31 "string_util.h", 32 "values_util.cc", 33 "values_util.h", 34 "util.cc", 35 "util.h", 36 ] 37 38 defines = [ 39 "DBUS_IMPLEMENTATION", 40 ] 41 42 deps = [ 43 "//base", 44 "//third_party/protobuf:protobuf_lite", 45 ] 46 47 public_configs = [ 48 "//build/config/linux:dbus", 49 ] 50} 51 52proto_library("test_proto") { 53 sources = [ "test_proto.proto" ] 54} 55 56# This target contains mocks that can be used to write unit tests without 57# issuing actual D-Bus calls. 58source_set("test_support") { 59 testonly = true 60 sources = [ 61 "mock_bus.cc", 62 "mock_bus.h", 63 "mock_exported_object.cc", 64 "mock_exported_object.h", 65 "mock_object_manager.cc", 66 "mock_object_manager.h", 67 "mock_object_proxy.cc", 68 "mock_object_proxy.h", 69 ] 70 71 deps = [ 72 ":dbus", 73 "//testing/gmock", 74 ] 75 76 configs += [ 77 "//build/config/linux:dbus", 78 ] 79} 80 81test("dbus_unittests") { 82 sources = [ 83 "bus_unittest.cc", 84 "dbus_statistics_unittest.cc", 85 "end_to_end_async_unittest.cc", 86 "end_to_end_sync_unittest.cc", 87 "message_unittest.cc", 88 "mock_unittest.cc", 89 "object_manager_unittest.cc", 90 "object_proxy_unittest.cc", 91 "property_unittest.cc", 92 "run_all_unittests.cc", 93 "signal_sender_verification_unittest.cc", 94 "string_util_unittest.cc", 95 "test_service.cc", 96 "test_service.h", 97 "util_unittest.cc", 98 "values_util_unittest.cc", 99 ] 100 101 deps = [ 102 ":dbus", 103 ":test_proto", 104 ":test_support", 105 "//base/test:test_support", 106 "//testing/gmock", 107 "//testing/gtest", 108 "//third_party/protobuf:protobuf_lite", 109 ] 110 111 configs += [ 112 "//build/config/linux:dbus", 113 ] 114} 115 116executable("dbus_test_server") { 117 testonly = true 118 sources = [ 119 "test_server.cc", 120 "test_service.cc", 121 "test_service.h", 122 ] 123 124 deps = [ 125 ":dbus", 126 "//base", 127 "//base/test:test_support", 128 ] 129 130 configs += [ 131 "//build/config/linux:dbus", 132 ] 133} 134