• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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
17MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/"
18module_output_path = "av_codec/moduletest"
19
20hevcswdecoder_moduletest_native_include_dirs = [
21  "./include",
22  "$MEDIA_ROOT_DIR/interfaces/kits/c",
23]
24
25hevcswdecoder_moduletest_cflags = [
26  "-std=c++17",
27  "-fno-rtti",
28  "-fno-exceptions",
29  "-Wall",
30  "-fno-common",
31  "-fstack-protector-strong",
32  "-Wshadow",
33  "-FPIC",
34  "-FS",
35  "-O2",
36  "-D_FORTIFY_SOURCE=2",
37  "-fvisibility=hidden",
38  "-Wformat=2",
39  "-Wdate-time",
40  "-Werror",
41  "-Wextra",
42  "-Wimplicit-fallthrough",
43  "-Wsign-compare",
44  "-Wunused-parameter",
45]
46
47##################################################################################################################
48ohos_unittest("hevcswdecoder_native_module_test") {
49  sanitize = av_codec_test_sanitize
50  module_out_path = module_output_path
51  include_dirs = hevcswdecoder_moduletest_native_include_dirs
52  include_dirs += [ "./" ]
53
54  cflags = hevcswdecoder_moduletest_cflags
55
56  if (av_codec_support_codec) {
57    sources = [
58      "./src/api_test.cpp",
59      "./src/func_test.cpp",
60      "./src/state_test.cpp",
61      "./src/videodec_api11_sample.cpp",
62      "./src/videodec_ndk_sample.cpp",
63    ]
64  }
65
66  deps = [
67    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase",
68    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_vdec",
69  ]
70  external_deps = [
71    "c_utils:utils",
72    "graphic_2d:libgraphic_utils",
73    "graphic_2d:librender_service_client",
74    "graphic_surface:surface",
75    "graphic_surface:sync_fence",
76    "hilog:libhilog",
77    "ipc:ipc_single",
78    "json:nlohmann_json_static",
79    "media_foundation:media_foundation",
80    "media_foundation:native_media_core",
81    "openssl:libcrypto_shared",
82    "window_manager:libwm",
83  ]
84  resource_config_file =
85      "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml"
86}
87