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