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