• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/media_foundation/unittest"
18
19group("format_unit_test") {
20  testonly = true
21  deps = [
22    ":format_capi_unit_test",
23    ":format_inner_unit_test",
24    ":format_unit_channel_layout_test",
25  ]
26}
27
28avcodec_unittest_cflags = [
29  "-std=c++17",
30  "-frtti",
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  "-Werror",
44  "-Wextra",
45  "-Wimplicit-fallthrough",
46  "-Wsign-compare",
47  "-Wunused-parameter",
48]
49
50##################################################################################################################
51ohos_unittest("format_capi_unit_test") {
52  module_out_path = module_output_path
53  include_dirs = [
54    "./",
55    "./capi",
56    "$histreamer_root_dir/interface/kits/c",
57  ]
58
59  cflags = avcodec_unittest_cflags
60
61  sources = [ "./avformat_unit_test.cpp" ]
62
63  defines = [
64    "HST_ANY_WITH_NO_RTTI",
65    "MEDIA_OHOS",
66    "AVFORMAT_CAPI_UNIT_TEST",
67  ]
68
69  public_deps = [ "../common:media_foundation_capi_unit_test" ]
70  external_deps = [
71    "c_utils:utils",
72    "ipc:ipc_single",
73  ]
74}
75
76##################################################################################################################
77ohos_unittest("format_inner_unit_test") {
78  module_out_path = module_output_path
79  include_dirs = [
80    "./",
81    "./inner",
82    "$histreamer_root_dir/interface/inner_api/buffer",
83  ]
84
85  cflags = avcodec_unittest_cflags
86
87  sources = [ "./avformat_unit_test.cpp" ]
88
89  defines = [
90    "HST_ANY_WITH_NO_RTTI",
91    "MEDIA_OHOS",
92  ]
93  public_deps = [ "../common:media_foundation_inner_unit_test" ]
94  external_deps = [
95    "c_utils:utils",
96    "ipc:ipc_single",
97  ]
98}
99
100##################################################################################################################
101ohos_unittest("format_unit_channel_layout_test") {
102  module_out_path = module_output_path
103  include_dirs = [
104    "./",
105    "./capi",
106    "$histreamer_root_dir/interface/inner_api/buffer",
107  ]
108
109  cflags = avcodec_unittest_cflags
110
111  sources = [ "./avformat_unit_channel_layout_test.cpp" ]
112
113  defines = [
114    "HST_ANY_WITH_NO_RTTI",
115    "MEDIA_OHOS",
116  ]
117  public_deps = [ "../common:media_foundation_inner_unit_test" ]
118  external_deps = [
119    "c_utils:utils",
120    "ipc:ipc_single",
121  ]
122}
123