BUILD.gn 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. import("//build/config/features.gni")
  5. import("//build/config/ui.gni")
  6. import("//testing/test.gni")
  7. import("//third_party/protobuf/proto_library.gni")
  8. assert(use_dbus)
  9. component("dbus") {
  10. sources = [
  11. "bus.cc",
  12. "bus.h",
  13. "dbus_export.h",
  14. "dbus_statistics.cc",
  15. "dbus_statistics.h",
  16. "exported_object.cc",
  17. "exported_object.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. "util.cc",
  33. "util.h",
  34. "values_util.cc",
  35. "values_util.h",
  36. ]
  37. defines = [ "DBUS_IMPLEMENTATION" ]
  38. deps = [ "//third_party/protobuf:protobuf_lite" ]
  39. public_deps = [ "//base" ]
  40. public_configs = [ "//build/config/linux/dbus" ]
  41. }
  42. proto_library("test_proto") {
  43. sources = [ "test_proto.proto" ]
  44. }
  45. # This target contains mocks that can be used to write unit tests without
  46. # issuing actual D-Bus calls.
  47. static_library("test_support") {
  48. testonly = true
  49. sources = [
  50. "mock_bus.cc",
  51. "mock_bus.h",
  52. "mock_exported_object.cc",
  53. "mock_exported_object.h",
  54. "mock_object_proxy.cc",
  55. "mock_object_proxy.h",
  56. ]
  57. public_deps = [ ":dbus" ]
  58. deps = [ "//testing/gmock" ]
  59. configs += [ "//build/config/linux/dbus" ]
  60. }
  61. test("dbus_unittests") {
  62. use_xvfb = use_xvfb_in_this_config
  63. sources = [
  64. "bus_unittest.cc",
  65. "dbus_statistics_unittest.cc",
  66. "end_to_end_async_unittest.cc",
  67. "end_to_end_sync_unittest.cc",
  68. "message_unittest.cc",
  69. "mock_unittest.cc",
  70. "object_manager_unittest.cc",
  71. "object_proxy_unittest.cc",
  72. "property_unittest.cc",
  73. "signal_sender_verification_unittest.cc",
  74. "string_util_unittest.cc",
  75. "test_service.cc",
  76. "test_service.h",
  77. "util_unittest.cc",
  78. "values_util_unittest.cc",
  79. ]
  80. deps = [
  81. ":dbus",
  82. ":test_proto",
  83. ":test_support",
  84. "//base/test:run_all_unittests",
  85. "//base/test:test_support",
  86. "//testing/gmock",
  87. "//testing/gtest",
  88. "//third_party/protobuf:protobuf_lite",
  89. ]
  90. configs += [ "//build/config/linux/dbus" ]
  91. }
  92. executable("dbus_test_server") {
  93. testonly = true
  94. sources = [
  95. "test_server.cc",
  96. "test_service.cc",
  97. "test_service.h",
  98. ]
  99. deps = [
  100. ":dbus",
  101. "//base",
  102. "//base/test:test_support",
  103. ]
  104. configs += [ "//build/config/linux/dbus" ]
  105. }