• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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")
15import("../../../ressched.gni")
16
17group("unittest") {
18  testonly = true
19  deps = [
20    ":resschedfileutil_test",
21    ":resschedjsonutil_test",
22    ":resschedstringutil_test",
23    ":resschedsystemutil_test",
24    ":resschedtimeutil_test",
25  ]
26}
27
28module_output_path = "resource_schedule_service/ressched/common"
29
30ohos_unittest("resschedfileutil_test") {
31  module_out_path = module_output_path
32  cflags = [
33    "-Dprivate=public",
34    "-Dprotected=public",
35  ]
36  include_dirs = [
37    "./include",
38    "${ressched_common}/include",
39  ]
40
41  sources = [ "src/res_sched_file_util_test.cpp" ]
42
43  deps = [ "${ressched_common}:ressched_common_utils" ]
44
45  external_deps = []
46
47  sanitize = {
48    cfi = true
49    cfi_cross_dso = true
50    debug = false
51  }
52  branch_protector_ret = "pac_ret"
53}
54
55ohos_unittest("resschedjsonutil_test") {
56  module_out_path = module_output_path
57  resource_config_file = "${ressched_common}/test/resource/ohos_test.xml"
58  cflags = [
59    "-Dprivate=public",
60    "-Dprotected=public",
61  ]
62  include_dirs = [
63    "./include",
64    "${ressched_common}/include",
65  ]
66
67  sources = [ "src/res_sched_json_util_test.cpp" ]
68
69  deps = [ "${ressched_common}:ressched_common_utils" ]
70
71  external_deps = [ "json:nlohmann_json_static" ]
72
73  sanitize = {
74    cfi = true
75    cfi_cross_dso = true
76    debug = false
77  }
78  branch_protector_ret = "pac_ret"
79}
80
81ohos_unittest("resschedstringutil_test") {
82  module_out_path = module_output_path
83  cflags = [
84    "-Dprivate=public",
85    "-Dprotected=public",
86  ]
87  include_dirs = [
88    "./include",
89    "${ressched_common}/include",
90  ]
91
92  sources = [ "src/res_sched_string_util_test.cpp" ]
93
94  deps = [ "${ressched_common}:ressched_common_utils" ]
95
96  external_deps = [ "json:nlohmann_json_static" ]
97
98  sanitize = {
99    cfi = true
100    cfi_cross_dso = true
101    debug = false
102  }
103  branch_protector_ret = "pac_ret"
104}
105
106ohos_unittest("resschedsystemutil_test") {
107  module_out_path = module_output_path
108  cflags = [
109    "-Dprivate=public",
110    "-Dprotected=public",
111  ]
112  include_dirs = [
113    "./include",
114    "${ressched_common}/include",
115  ]
116
117  sources = [ "src/res_sched_system_util_test.cpp" ]
118
119  deps = [ "${ressched_common}:ressched_common_utils" ]
120
121  external_deps = []
122
123  sanitize = {
124    cfi = true
125    cfi_cross_dso = true
126    debug = false
127  }
128  branch_protector_ret = "pac_ret"
129}
130
131ohos_unittest("resschedtimeutil_test") {
132  module_out_path = module_output_path
133  cflags = [
134    "-Dprivate=public",
135    "-Dprotected=public",
136  ]
137  include_dirs = [
138    "./include",
139    "${ressched_common}/include",
140  ]
141
142  sources = [ "src/res_sched_time_util_test.cpp" ]
143
144  deps = [ "${ressched_common}:ressched_common_utils" ]
145
146  external_deps = []
147
148  sanitize = {
149    cfi = true
150    cfi_cross_dso = true
151    debug = false
152  }
153  branch_protector_ret = "pac_ret"
154}
155