1# Copyright (c) 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("//foundation/multimedia/media_foundation/config.gni")
16
17module_output_path = "media_foundation/unittest"
18
19group("avbuffer_unit_test") {
20  testonly = true
21  deps = [
22    ":avbuffer_capi_unit_test",
23    ":avbuffer_inner_unit_test",
24    ":avsharedmemorybase_func_unit_test",
25  ]
26}
27
28avbuffer_unittest_cflags = [
29  "-std=c++17",
30  "-fno-rtti",
31  "-fexceptions",
32  "-Wall",
33  "-fno-common",
34  "-fstack-protector-strong",
35  "-Wshadow",
36  "-FPIC",
37  "-FS",
38  "-O2",
39  "-D_FORTIFY_SOURCE=2",
40  "-fvisibility=hidden",
41  "-Wformat=2",
42  "-Wdate-time",
43  "-Wextra",
44  "-Wimplicit-fallthrough",
45  "-Wsign-compare",
46  "-Dprivate=public",
47  "-Dprotected=public",
48]
49
50#################################################################################################################videodec
51ohos_unittest("avbuffer_inner_unit_test") {
52  module_out_path = module_output_path
53  include_dirs = [
54    "./",
55    "./inner",
56  ]
57
58  defines = [
59    "HST_ANY_WITH_NO_RTTI",
60    "MEDIA_OHOS",
61  ]
62
63  sources = [
64    "./avbuffer_framework_unit_test.cpp",
65    "./avbuffer_func_unit_test.cpp",
66    "./avbuffer_unit_test.cpp",
67  ]
68
69  cflags = avbuffer_unittest_cflags
70
71  public_deps = [ "../common:media_foundation_inner_unit_test" ]
72
73  external_deps = [
74    "c_utils:utils",
75    "graphic_surface:surface",
76    "graphic_surface:sync_fence",
77    "hilog:libhilog",
78    "ipc:ipc_core",
79    "memory_utils:libdmabufheap",
80  ]
81}
82
83#################################################################################################################videodec
84ohos_unittest("avbuffer_capi_unit_test") {
85  module_out_path = module_output_path
86  include_dirs = [
87    "./",
88    "./capi",
89    "$histreamer_root_dir/interface/kits/c",
90  ]
91
92  defines = [
93    "AVBUFFER_CAPI_UNIT_TEST",
94    "MEDIA_OHOS",
95  ]
96
97  sources = [
98    "./avbuffer_framework_unit_test.cpp",
99    "./avbuffer_unit_test.cpp",
100  ]
101
102  cflags = avbuffer_unittest_cflags
103
104  public_deps = [ "../common:media_foundation_capi_unit_test" ]
105
106  external_deps = [
107    "c_utils:utils",
108    "graphic_surface:surface",
109    "graphic_surface:sync_fence",
110    "hilog:libhilog",
111    "ipc:ipc_core",
112    "memory_utils:libdmabufheap",
113  ]
114}
115
116#################################################################################################################videodec
117ohos_unittest("avsharedmemorybase_func_unit_test") {
118  module_out_path = module_output_path
119  include_dirs = [
120    "./",
121    "./inner",
122    "../../../interface/inner_api",
123  ]
124
125  sanitize = {
126    cfi = true
127    cfi_cross_dso = true
128    debug = false
129  }
130
131  defines = [
132    "AVSHAREDMEMORYBASE_FUNC_UNIT_TEST",
133    "MEDIA_OHOS",
134  ]
135
136  sources = [ "./avsharedmemorybase_func_unit_test.cpp" ]
137
138  cflags = avbuffer_unittest_cflags
139
140  public_deps = [ "../common:media_foundation_capi_unit_test" ]
141
142  external_deps = [
143    "c_utils:utils",
144    "graphic_surface:surface",
145    "graphic_surface:sync_fence",
146    "hilog:libhilog",
147    "ipc:ipc_core",
148    "memory_utils:libdmabufheap",
149  ]
150}
151