• 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
19av_codec_unittest_include_dirs =
20    [ "$av_codec_root_dir/interfaces/inner_api/native" ]
21
22av_codec_unittest_cflags = [
23  "-std=c++17",
24  "-fno-rtti",
25  "-fno-exceptions",
26  "-Wall",
27  "-fno-common",
28  "-fstack-protector-strong",
29  "-Wshadow",
30  "-FPIC",
31  "-FS",
32  "-O2",
33  "-D_FORTIFY_SOURCE=2",
34  "-fvisibility=hidden",
35  "-Wformat=2",
36  "-Wdate-time",
37  "-Werror",
38  "-Wextra",
39  "-Wimplicit-fallthrough",
40  "-Wsign-compare",
41  "-Wunused-parameter",
42]
43
44##################################################################################################################
45ohos_unittest("av_audio_sink_unit_test") {
46  module_out_path = module_output_path
47  include_dirs = av_codec_unittest_include_dirs
48  include_dirs += [
49    "$audio_framework_root_dir/interfaces/inner_api/native/audiocommon/include",
50    "$av_codec_root_dir/interfaces",
51    "$av_codec_root_dir/interfaces/plugin",
52    "$av_codec_root_dir/services/media_engine/plugins/sink",
53    "$av_codec_root_dir/services/media_engine/modules",
54    "$av_codec_root_dir/services/media_engine/modules/sink",
55    "$media_foundation_root_dir/interface/inner_api",
56    "$media_foundation_root_dir/interface/kits/c",
57    "$media_foundation_root_dir/../../graphic/graphic_surface/interfaces/innerkits/surface",
58    "$media_foundation_root_dir/../../graphic/graphic_surface/interface/inner_api/surface",
59    "$media_foundation_root_dir/../../graphic/graphic_surface/surface/include",
60  ]
61
62  cflags = av_codec_unittest_cflags
63
64  cflags_cc = cflags
65
66  public_configs = []
67
68  if (av_codec_support_test) {
69    sources = [ "./audio_sink_test.cpp" ]
70  }
71
72  deps = [ "$av_codec_root_dir/services/media_engine/modules:av_codec_media_engine_modules" ]
73
74  external_deps = [
75    "audio_framework:audio_renderer",
76    "c_utils:utils",
77    "graphic_surface:surface",
78    "hilog:libhilog",
79    "ipc:ipc_single",
80    "media_foundation:media_foundation",
81    "safwk:system_ability_fwk",
82  ]
83
84  resource_config_file =
85      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
86}
87