• 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/av_codec/config.gni")
16
17module_output_path = "av_codec/unittest"
18
19avmuxer_unittest_cflags = [
20  "-std=c++17",
21  "-fno-rtti",
22  "-fno-exceptions",
23  "-Wall",
24  "-fno-common",
25  "-fstack-protector-strong",
26  "-Wshadow",
27  "-FPIC",
28  "-FS",
29  "-O2",
30  "-D_FORTIFY_SOURCE=2",
31  "-fvisibility=hidden",
32  "-Wformat=2",
33  "-Wdate-time",
34  "-Werror",
35  "-Wextra",
36  "-Wimplicit-fallthrough",
37  "-Wsign-compare",
38  "-Wunused-parameter",
39]
40
41#################################################################################################################muxer
42ohos_unittest("avmuxer_capi_unit_test") {
43  module_out_path = module_output_path
44  include_dirs = [
45    "./",
46    "./capi",
47  ]
48
49  cflags = avmuxer_unittest_cflags
50
51  if (av_codec_support_muxer) {
52    sources = [
53      "./avmuxer_sample.cpp",
54      "./avmuxer_unit_test.cpp",
55      "./capi/avmuxer_capi_mock.cpp",
56      "./capi/avmuxer_capi_mock_factory.cpp",
57    ]
58  }
59
60  if (target_cpu == "arm64") {
61    av_codec_path = "\"/system/lib64\""
62  } else {
63    av_codec_path = "\"/system/lib\""
64  }
65  defines = [
66    "AVMUXER_UNITTEST_CAPI",
67    "AV_CODEC_PATH=${av_codec_path}",
68  ]
69
70  public_deps =
71      [ "$av_codec_root_dir/test/unittest/common:av_codec_capi_unit_test" ]
72
73  deps = [ "$av_codec_root_dir/interfaces/kits/c:capi_packages" ]
74
75  external_deps = [
76    "av_codec:av_codec_client",
77    "graphic_surface:surface",
78  ]
79
80  resource_config_file =
81      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
82}
83
84#################################################################################################################muxer
85ohos_unittest("avmuxer_inner_unit_test") {
86  module_out_path = module_output_path
87  include_dirs = [
88    "./",
89    "./inner",
90  ]
91
92  cflags = avmuxer_unittest_cflags
93
94  if (av_codec_support_muxer) {
95    sources = [
96      "./avmuxer_sample.cpp",
97      "./avmuxer_unit_test.cpp",
98      "./inner/avmuxer_inner_mock.cpp",
99      "./inner/avmuxer_inner_mock_factory.cpp",
100    ]
101  }
102
103  if (target_cpu == "arm64") {
104    av_codec_path = "\"/system/lib64\""
105  } else {
106    av_codec_path = "\"/system/lib\""
107  }
108  defines = [ "AV_CODEC_PATH=${av_codec_path}" ]
109
110  public_deps =
111      [ "$av_codec_root_dir/test/unittest/common:av_codec_inner_unit_test" ]
112
113  deps = [ "$av_codec_root_dir/interfaces/kits/c:native_media_codecbase" ]
114
115  external_deps = [
116    "av_codec:av_codec_client",
117    "graphic_surface:surface",
118  ]
119
120  resource_config_file =
121      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
122}
123