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
5component("sql") {
6  sources = [
7    "connection.cc",
8    "connection.h",
9    "error_delegate_util.cc",
10    "error_delegate_util.h",
11    "init_status.h",
12    "meta_table.cc",
13    "meta_table.h",
14    "recovery.cc",
15    "recovery.h",
16    "statement.cc",
17    "statement.h",
18    "transaction.cc",
19    "transaction.h",
20  ]
21
22  defines = [ "SQL_IMPLEMENTATION" ]
23
24  if (is_win) {
25    cflags = [ "/wd4267" ]  # size_t to int.
26  }
27
28  deps = [
29    "//base",
30    "//third_party/sqlite",
31    "//base/third_party/dynamic_annotations",
32  ]
33}
34
35source_set("test_support") {
36  testonly = true
37  sources = [
38    "test/error_callback_support.cc",
39    "test/error_callback_support.h",
40    "test/scoped_error_ignorer.cc",
41    "test/scoped_error_ignorer.h",
42    "test/test_helpers.cc",
43    "test/test_helpers.h",
44  ]
45
46  deps = [
47    ":sql",
48    "//base",
49    "//testing/gtest",
50  ]
51}
52
53test("sql_unittests") {
54  sources = [
55    "connection_unittest.cc",
56    "meta_table_unittest.cc",
57    "recovery_unittest.cc",
58    "sqlite_features_unittest.cc",
59    "statement_unittest.cc",
60    "test/paths.cc",
61    "test/paths.h",
62    "test/run_all_unittests.cc",
63    "test/sql_test_suite.cc",
64    "test/sql_test_suite.h",
65    "transaction_unittest.cc",
66  ]
67
68  if (is_win) {
69    cflags = [ "/wd4267" ]  # size_t -> int
70  }
71
72  deps = [
73    ":sql",
74    ":test_support",
75    "//base/allocator",
76    "//base/test:test_support",
77    "//testing/gtest",
78    "//third_party/sqlite",
79  ]
80
81  # TODO(GYP)
82  #['OS == "android"', {
83  #  'dependencies': [
84  #    '../testing/android/native_test.gyp:native_test_native_code',
85  #  ],
86  #}],
87}
88
89if (is_android) {
90  #TODO(GYP)
91  #'target_name': 'sql_unittests_apk',
92  #'type': 'none',
93  #'dependencies': [
94  #  'sql_unittests',
95  #],
96  #'variables': {
97  #  'test_suite_name': 'sql_unittests',
98  #},
99  #'includes': [ '../build/apk_test.gypi' ],
100}
101