• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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.
13
14if (defined(ohos_lite)) {
15  import("//build/lite/config/component/lite_component.gni")
16  import("//build/lite/config/test.gni")
17  test_output_root = "$root_out_dir/test/unittest/syscap_codec"
18
19  executable("test_syscap_napi_unittest") {
20    output_extension = "bin"
21    output_dir = test_output_root
22
23    include_dirs = [
24      "//commonlibrary/c_utils/base/include",
25      "//third_party/node/src",
26      "//third_party/googletest/include",
27      "//developtools/syscap_codec/src/",
28      "//developtools/syscap_codec/include/",
29      "//developtools/syscap_codec/interfaces/inner_api/",
30      "//developtools/syscap_codec/test/unittest/common/include/",
31    ]
32
33    cflags = [ "-g3" ]
34
35    sources = [
36      "//developtools/syscap_codec/interfaces/inner_api/syscap_interface.c",
37      "//developtools/syscap_codec/src/create_pcid.c",
38      "//developtools/syscap_codec/src/endian_internal.c",
39      "//developtools/syscap_codec/src/syscap_tool.c",
40      "syscap_codec_test.cpp",
41    ]
42
43    defines = [ "NAPI_TEST" ]
44
45    deps = [
46      "//base//hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
47      "//test/testfwk/developer_test/third_party/lib/cpp:gtest_main",
48      "//third_party/bounds_checking_function:libsec_static",
49    ]
50
51    deps += [ "//build/lite/config/component/cJSON:cjson_static" ]
52  }
53
54  group("unittest") {
55    deps = [ ":test_syscap_napi_unittest" ]
56  }
57} else {
58  import("//build/lite/config/component/lite_component.gni")
59  import("//build/ohos.gni")
60  import("//build/test.gni")
61
62  module_output_path = "developtools/syscap_codec"
63
64  ohos_unittest("syscap_codec_test") {
65    module_out_path = module_output_path
66
67    include_dirs = [
68      "//developtools/syscap_codec/src/",
69      "//developtools/syscap_codec/include/",
70      "//developtools/syscap_codec/interfaces/inner_api/",
71      "//developtools/syscap_codec/test/unittest/common/include/",
72    ]
73
74    sources = [
75      "//developtools/syscap_codec/interfaces/inner_api/syscap_interface.c",
76      "//developtools/syscap_codec/src/create_pcid.c",
77      "//developtools/syscap_codec/src/endian_internal.c",
78      "//developtools/syscap_codec/src/syscap_tool.c",
79      "syscap_codec_test.cpp",
80    ]
81
82    deps = [
83      "//third_party/bounds_checking_function:libsec_static",
84      "//third_party/googletest:gtest_main",
85    ]
86
87    deps += [ "//third_party/cJSON:cjson_static" ]
88  }
89
90  group("unittest") {
91    testonly = true
92    deps = [ ":syscap_codec_test" ]
93  }
94}
95