• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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/test.gni")
15
16hdf_framework_path = "./../../../../../framework"
17hdf_adapter_path = "./../../../../../adapter"
18
19module_output_path = "hdf_core/osal"
20ohos_unittest("hdf_adapter_uhdf_test_osal") {
21  module_out_path = module_output_path
22
23  include_dirs = [
24    "$hdf_framework_path/include/platform",
25    "$hdf_framework_path/include/core",
26    "$hdf_framework_path/include/osal",
27    "$hdf_adapter_path/uhdf/posix/include",
28    "$hdf_framework_path/include/utils",
29    "$hdf_framework_path/include",
30    "$hdf_framework_path/test/unittest/include",
31    "$hdf_framework_path/test/unittest/osal",
32  ]
33  if (build_selinux) {
34    cflags = [ "-DWITH_SELINUX" ]
35  }
36  defines = [ "__USER__" ]
37  sources = [
38    "$hdf_framework_path/support/posix/test/unittest/common/hdf_osal_test.cpp",
39  ]
40  deps = [
41    "$hdf_adapter_path/build/test_common:libhdf_test_common",
42    "$hdf_adapter_path/uhdf2/utils:libhdf_utils",
43  ]
44  resource_config_file =
45      "$hdf_adapter_path/uhdf2/test/resource/osal/ohos_test.xml"
46  if (is_standard_system) {
47    external_deps = [
48      "c_utils:utils",
49      "hilog:libhilog",
50    ]
51  } else {
52    external_deps = [ "hilog:libhilog" ]
53  }
54}
55
56ohos_unittest("hdf_adapter_uhdf_test_osal_posix") {
57  module_out_path = module_output_path
58
59  include_dirs = [
60    "$hdf_framework_path/include/platform",
61    "$hdf_framework_path/include/core",
62    "$hdf_framework_path/include/osal",
63    "$hdf_adapter_path/uhdf/posix/include",
64    "$hdf_framework_path/include/utils",
65    "$hdf_framework_path/include",
66    "$hdf_framework_path/test/unittest/include",
67    "$hdf_framework_path/test/unittest/osal",
68  ]
69
70  defines = [ "__USER__" ]
71  sources = [
72    "$hdf_framework_path/support/posix/test/unittest/common/hdf_osal_test_posix.cpp",
73    "$hdf_framework_path/test/unittest/osal/osal_all_test.c",
74    "$hdf_framework_path/test/unittest/osal/osal_get_case_test.c",
75    "$hdf_framework_path/test/unittest/osal/osal_list_test.c",
76  ]
77  deps = [ "$hdf_adapter_path/uhdf2/utils:libhdf_utils" ]
78
79  if (is_standard_system) {
80    external_deps = [
81      "c_utils:utils",
82      "hilog:libhilog",
83    ]
84  } else {
85    external_deps = [ "hilog:libhilog" ]
86  }
87}
88