• 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
17source_set("hls_test_set") {
18  sources = [ "$av_codec_root_dir/services/media_engine/plugins/source/http_source/hls/m3u8.cpp" ]
19}
20
21config("hls_unittest_cfg") {
22  defines = [
23    "HST_ANY_WITH_NO_RTTI",
24    "MEDIA_OHOS",
25  ]
26
27  cflags = [
28    "-Wno-sign-compare",
29    "-fno-exceptions",
30    "-fno-common",
31    "-fstack-protector-all",
32    "-Wshadow",
33    "-FPIC",
34    "-FS",
35    "-O2",
36    "-D_FORTIFY_SOURCE=2",
37    "-Wformat=2",
38    "-Wdate-time",
39  ]
40
41  cflags_cc = [
42    "-std=c++17",
43    "-fno-rtti",
44  ]
45
46  include_dirs = [
47    "$av_codec_root_dir/interfaces",
48    "$av_codec_root_dir/interfaces/inner_api/native",
49    "$av_codec_root_dir/services/media_engine/plugins/source/http_source",
50    "$media_foundation_root_dir/interface/inner_api",
51    "$media_foundation_root_dir/src",
52    "//third_party/ffmpeg",
53    "//third_party/curl/include",
54    "//third_party/openssl/include",
55  ]
56}
57
58ohos_unittest("hls_media_downloader_unit_test") {
59  testonly = true
60  configs = [ ":hls_unittest_cfg" ]
61  module_out_path = "av_codec/plugin/hls"
62  sources = [ "hls_media_downloader_unit_test.cpp" ]
63  deps = [
64    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
65    "$av_codec_root_dir/services/media_engine/plugins/source/http_source:media_plugin_HttpSource",
66    "//third_party/curl:curl_shared",
67    "//third_party/openssl:libcrypto_shared",
68  ]
69
70  external_deps = [
71    "c_utils:utils",
72    "graphic_surface:surface",
73    "hilog:libhilog",
74    "ipc:ipc_single",
75    "media_foundation:media_foundation",
76    "safwk:system_ability_fwk",
77  ]
78
79  relative_install_dir = "media/media_plugins"
80  subsystem_name = "multimedia"
81  part_name = "av_codec"
82  resource_config_file =
83      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
84}
85
86ohos_unittest("hls_playlist_downloader_unit_test") {
87  testonly = true
88  configs = [ ":hls_unittest_cfg" ]
89  module_out_path = "av_codec/plugin/hls"
90  sources = [ "hls_playlist_downloader_unit_test.cpp" ]
91  deps = [
92    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
93    "$av_codec_root_dir/services/media_engine/plugins/source/http_source:media_plugin_HttpSource",
94    "//third_party/curl:curl_shared",
95    "//third_party/openssl:libcrypto_shared",
96  ]
97
98  external_deps = [
99    "c_utils:utils",
100    "graphic_surface:surface",
101    "hilog:libhilog",
102    "ipc:ipc_single",
103    "media_foundation:media_foundation",
104    "safwk:system_ability_fwk",
105  ]
106
107  relative_install_dir = "media/media_plugins"
108  subsystem_name = "multimedia"
109  part_name = "av_codec"
110  resource_config_file =
111      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
112}
113
114ohos_unittest("hls_tags_unit_test") {
115  testonly = true
116  configs = [ ":hls_unittest_cfg" ]
117  module_out_path = "av_codec/plugin/hls"
118  sources = [ "hls_tags_unit_test.cpp" ]
119  deps = [
120    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
121    "$av_codec_root_dir/services/media_engine/plugins/source/http_source:media_plugin_HttpSource",
122    "//third_party/curl:curl_shared",
123    "//third_party/openssl:libcrypto_shared",
124  ]
125
126  external_deps = [
127    "c_utils:utils",
128    "graphic_surface:surface",
129    "hilog:libhilog",
130    "ipc:ipc_single",
131    "media_foundation:media_foundation",
132    "safwk:system_ability_fwk",
133  ]
134
135  relative_install_dir = "media/media_plugins"
136  subsystem_name = "multimedia"
137  part_name = "av_codec"
138  resource_config_file =
139      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
140}
141
142ohos_unittest("m3u8_unit_test") {
143  testonly = true
144  module_out_path = "av_codec/plugin/hls"
145  configs = [ ":hls_unittest_cfg" ]
146  sources = [ "m3u8_unit_test.cpp" ]
147  deps = [
148    "$av_codec_root_dir/services/dfx:av_codec_service_dfx",
149    "$av_codec_root_dir/services/media_engine/plugins/source/http_source:media_plugin_HttpSource",
150    "//third_party/curl:curl_shared",
151    "//third_party/openssl:libcrypto_shared",
152  ]
153
154  external_deps = [
155    "c_utils:utils",
156    "graphic_surface:surface",
157    "hilog:libhilog",
158    "ipc:ipc_single",
159    "media_foundation:media_foundation",
160    "safwk:system_ability_fwk",
161  ]
162
163  relative_install_dir = "media/media_plugins"
164  subsystem_name = "multimedia"
165  part_name = "av_codec"
166  resource_config_file =
167      "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
168}
169