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
17MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/"
18module_output_path = "av_codec/moduletest"
19
20encoder_moduletest_native_include_dirs = [
21  "./include",
22  "$MEDIA_ROOT_DIR/../../graphic/graphic_2d/interfaces/inner_api",
23  "$MEDIA_ROOT_DIR/interfaces/kits/c",
24  "$MEDIA_ROOT_DIR/interfaces/inner_api/native",
25  "$MEDIA_ROOT_DIR/../../../third_party/openssl/ohos_lite/include",
26]
27
28encoder_moduletest_cflags = [
29  "-std=c++17",
30  "-fno-rtti",
31  "-fno-exceptions",
32  "-Wall",
33  "-fno-common",
34  "-fstack-protector-strong",
35  "-Wshadow",
36  "-FPIC",
37  "-FS",
38  "-O2",
39  "-D_FORTIFY_SOURCE=2",
40  "-fvisibility=hidden",
41  "-Wformat=2",
42  "-Wdate-time",
43  "-Werror",
44  "-Wextra",
45  "-Wimplicit-fallthrough",
46  "-Wsign-compare",
47  "-Wunused-parameter",
48]
49
50##################################################################################################################
51ohos_unittest("encoder_native_module_test") {
52  sanitize = av_codec_test_sanitize
53  module_out_path = module_output_path
54  include_dirs = encoder_moduletest_native_include_dirs
55  include_dirs += [ "./" ]
56  cflags = encoder_moduletest_cflags
57
58  if (av_codec_support_codec) {
59    sources = [
60      "./src/InnerAPI/api_test.cpp",
61      "./src/InnerAPI/func_test.cpp",
62      "./src/InnerAPI/videoenc_ndk_inner_sample.cpp",
63      "./src/api_test.cpp",
64      "./src/configure_test.cpp",
65      "./src/func_test.cpp",
66      "./src/temporal_test.cpp",
67
68      #"./src/perf_test.cpp",
69      "./src/getparam_test.cpp",
70
71      #"./src/reli_test.cpp",
72      "./src/setparam_test.cpp",
73      "./src/state_test.cpp",
74      "./src/videoenc_api11_sample.cpp",
75      "./src/videoenc_ndk_sample.cpp",
76    ]
77  }
78
79  deps = [
80    "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client",
81    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase",
82    "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_venc",
83  ]
84  external_deps = [
85    "c_utils:utils",
86    "graphic_2d:libgraphic_utils",
87    "graphic_2d:librender_service_client",
88    "graphic_surface:surface",
89    "hilog:libhilog",
90    "ipc:ipc_core",
91    "media_foundation:media_foundation",
92    "media_foundation:native_media_core",
93    "window_manager:libwm",
94  ]
95
96  resource_config_file =
97      "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml"
98}
99