BUILD.gn 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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("//testing/test.gni")
  5. component("sql") {
  6. sources = [
  7. "database.cc",
  8. "database.h",
  9. "database_memory_dump_provider.cc",
  10. "database_memory_dump_provider.h",
  11. "error_delegate_util.cc",
  12. "error_delegate_util.h",
  13. "init_status.h",
  14. "initialization.cc",
  15. "initialization.h",
  16. "internal_api_token.h",
  17. "meta_table.cc",
  18. "meta_table.h",
  19. "recover_module/btree.cc",
  20. "recover_module/btree.h",
  21. "recover_module/cursor.cc",
  22. "recover_module/cursor.h",
  23. "recover_module/integers.cc",
  24. "recover_module/integers.h",
  25. "recover_module/module.cc",
  26. "recover_module/module.h",
  27. "recover_module/pager.cc",
  28. "recover_module/pager.h",
  29. "recover_module/parsing.cc",
  30. "recover_module/parsing.h",
  31. "recover_module/payload.cc",
  32. "recover_module/payload.h",
  33. "recover_module/record.cc",
  34. "recover_module/record.h",
  35. "recover_module/table.cc",
  36. "recover_module/table.h",
  37. "recovery.cc",
  38. "recovery.h",
  39. "sandboxed_vfs.cc",
  40. "sandboxed_vfs.h",
  41. "sandboxed_vfs_file.cc",
  42. "sandboxed_vfs_file.h",
  43. "sql_features.cc",
  44. "sql_features.h",
  45. "sql_memory_dump_provider.cc",
  46. "sql_memory_dump_provider.h",
  47. "sqlite_result_code.cc",
  48. "sqlite_result_code.h",
  49. "sqlite_result_code_values.cc",
  50. "sqlite_result_code_values.h",
  51. "statement.cc",
  52. "statement.h",
  53. "statement_id.cc",
  54. "statement_id.h",
  55. "transaction.cc",
  56. "transaction.h",
  57. "vfs_wrapper.cc",
  58. "vfs_wrapper.h",
  59. ]
  60. defines = [ "IS_SQL_IMPL" ]
  61. deps = [
  62. "//base",
  63. "//base/third_party/dynamic_annotations",
  64. "//third_party/sqlite",
  65. ]
  66. # For vfs_wrapper.cc time-machine exclusions.
  67. if (is_mac) {
  68. frameworks = [
  69. "CoreFoundation.framework",
  70. "CoreServices.framework",
  71. ]
  72. }
  73. if (is_fuchsia) {
  74. sources += [
  75. "vfs_wrapper_fuchsia.cc",
  76. "vfs_wrapper_fuchsia.h",
  77. ]
  78. }
  79. }
  80. static_library("test_support") {
  81. testonly = true
  82. sources = [
  83. "test/scoped_error_expecter.cc",
  84. "test/scoped_error_expecter.h",
  85. "test/test_helpers.cc",
  86. "test/test_helpers.h",
  87. ]
  88. public_deps = [ ":sql" ]
  89. deps = [
  90. "//base",
  91. "//testing/gtest",
  92. "//third_party/sqlite",
  93. ]
  94. }
  95. bundle_data("sql_unittests_bundle_data") {
  96. testonly = true
  97. sources = [ "test/data/recovery_387868" ]
  98. outputs = [ "{{bundle_resources_dir}}/" +
  99. "{{source_root_relative_dir}}/{{source_file_part}}" ]
  100. }
  101. test("sql_unittests") {
  102. sources = [
  103. "database_options_unittest.cc",
  104. "database_unittest.cc",
  105. "meta_table_unittest.cc",
  106. "recover_module/module_unittest.cc",
  107. "recovery_unittest.cc",
  108. "sql_memory_dump_provider_unittest.cc",
  109. "sqlite_features_unittest.cc",
  110. "sqlite_result_code_unittest.cc",
  111. "statement_id_unittest.cc",
  112. "statement_unittest.cc",
  113. "test/database_test_peer.cc",
  114. "test/database_test_peer.h",
  115. "test/paths.cc",
  116. "test/paths.h",
  117. "test/run_all_unittests.cc",
  118. "test/sql_test_suite.cc",
  119. "test/sql_test_suite.h",
  120. "transaction_unittest.cc",
  121. ]
  122. data = [ "test/data/" ]
  123. deps = [
  124. ":sql",
  125. ":sql_unittests_bundle_data",
  126. ":test_support",
  127. "//base/test:test_support",
  128. "//testing/gtest",
  129. "//third_party/sqlite",
  130. ]
  131. }