• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13import("//build/test.gni")
14import("//build/ohos.gni")
15import("//third_party/sqlite/sqlite.gni")
16
17module_output_path = "third_party_sqlite/third_party_sqlite"
18
19###############################################################################
20config("module_private_config") {
21  visibility = [ ":*" ]
22
23  defines = [
24  ]
25  cflags_c = [
26    "-fvisibility=hidden",
27    "-Wno-implicit-fallthrough",
28  ]
29  if (target_os != "ios") {
30    ldflags = [ "-Wl,--exclude-libs,ALL" ]
31  }
32}
33
34ohos_unittest("libsqlittest") {
35  module_out_path = module_output_path
36
37  sources = [
38    "./common.cpp",
39    "./sqlite_cksum_test.cpp",
40    "./sqlite_compress_test.cpp",
41    "./sqlite_metadwr_test.cpp",
42    "./sqlite_test.cpp",
43  ]
44
45  if (sqlite_support_check_pages) {
46    defines = [
47      "SQLITE_SUPPORT_PAGE_CHECK_TEST",
48      "SQLITE_SUPPORT_PAGE_COMPRESS_TEST"
49    ]
50
51    sources += [
52      "./sqlite_binlog_test.cpp",
53    ]
54  }
55
56  configs = [ ":module_private_config" ]
57
58  external_deps = [
59    "c_utils:utils",
60    "googletest:gtest_main",
61  ]
62
63  deps = [
64    "//third_party/sqlite:sqlite",
65  ]
66}
67
68###############################################################################
69group("unittest") {
70  testonly = true
71
72  deps = [ ":libsqlittest" ]
73}