• 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
19codeclist_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#################################################################################################################codeclist
42ohos_unittest("codeclist_capi_unit_test") {
43  module_out_path = module_output_path
44  include_dirs = [
45    "./",
46    "./capi",
47  ]
48
49  defines = [ "CODECLIST_CAPI_UNIT_TEST" ]
50
51  cflags = codeclist_unittest_cflags
52
53  if (av_codec_support_codeclist) {
54    sources = [
55      "./capi/codeclist_capi_mock.cpp",
56      "./capi/codeclist_capi_mock_factory.cpp",
57      "./caps_unit_test.cpp",
58      "./codeclist_unit_test.cpp",
59    ]
60  }
61
62  public_deps =
63      [ "$av_codec_root_dir/test/unittest/common:av_codec_capi_unit_test" ]
64
65  external_deps = [
66    "c_utils:utils",
67    "graphic_surface:surface",
68    "graphic_surface:sync_fence",
69    "hilog:libhilog",
70    "media_foundation:capi_packages",
71    "media_foundation:media_foundation",
72  ]
73
74  resource_config_file =
75      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
76}
77
78#################################################################################################################codeclist
79ohos_unittest("codeclist_inner_unit_test") {
80  module_out_path = module_output_path
81  include_dirs = [
82    "./",
83    "./inner",
84  ]
85
86  defines = [ "CODECLIST_INNER_UNIT_TEST" ]
87
88  cflags = codeclist_unittest_cflags
89
90  if (av_codec_support_codeclist) {
91    sources = [
92      "./caps_unit_test.cpp",
93      "./codeclist_unit_test.cpp",
94      "./inner/codeclist_inner_mock.cpp",
95      "./inner/codeclist_inner_mock_factory.cpp",
96    ]
97  }
98
99  public_deps =
100      [ "$av_codec_root_dir/test/unittest/common:av_codec_inner_unit_test" ]
101
102  external_deps = [
103    "c_utils:utils",
104    "graphic_surface:surface",
105    "graphic_surface:sync_fence",
106    "hilog:libhilog",
107    "media_foundation:media_foundation",
108  ]
109
110  resource_config_file =
111      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
112}
113