# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("//foundation/multimedia/player_framework/config.gni") module_output_path = "$MODULE_OUTPUT_PATH/avcodec" avcodec_unittest_native_include_dirs = [ "../../../../../../foundation/window/window_manager/interfaces/innerkits/wm", "../../../interfaces/inner_api/native", "../../../test/unittest/avcodec_test/native/audiodecoder/", "../../../test/unittest/avcodec_test/native/audioencoder/", "../../../test/unittest/avcodec_test/native/avcodec_info/", "../../../test/unittest/avcodec_test/native/avcodec_list/", "../../../test/unittest/avcodec_test/native/avformat/", "../../../test/unittest/avcodec_test/native/avmemory/", "../../../test/unittest/avcodec_test/native/enum/", "../../../test/unittest/avcodec_test/native/surface/", "../../../test/unittest/avcodec_test/native/videodecoder/", "../../../test/unittest/avcodec_test/native/videoencoder/", "../../../test/unittest/common/include/", ] avcodec_unittest_cflags = [ "-std=c++17", "-fno-rtti", "-fno-exceptions", "-Wall", "-fno-common", "-fstack-protector-strong", "-Wshadow", "-FPIC", "-FS", "-O2", "-D_FORTIFY_SOURCE=2", "-fvisibility=hidden", "-Wformat=2", "-Wdate-time", "-Werror", "-Wextra", "-Wimplicit-fallthrough", "-Wsign-compare", "-Wunused-parameter", ] ################################################################################################################## ohos_unittest("vcodec_native_unit_test") { module_out_path = module_output_path include_dirs = avcodec_unittest_native_include_dirs include_dirs += [ "./", "./vcodec_test", ] cflags = avcodec_unittest_cflags if (multimedia_player_framework_support_codec) { sources = [ "./native/avcodec_info/avcodec_info_native_mock.cpp", "./native/avcodec_list/avcodec_list_native_mock.cpp", "./native/avcodec_mock_factory.cpp", "./native/avformat/avformat_native_mock.cpp", "./native/avmemory/avmemory_native_mock.cpp", "./native/enum/enum_native_mock.cpp", "./native/surface/surface_native_mock.cpp", "./native/videodecoder/videodec_native_mock.cpp", "./native/videoencoder/videoenc_native_mock.cpp", "./vcodec_test/vcodec_unit_test.cpp", "./vcodec_test/vdec_mock.cpp", "./vcodec_test/venc_mock.cpp", ] } deps = [ "../../../../../../foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client", "../../../../../../foundation/window/window_manager/wm:libwm", ] external_deps = [ "c_utils:utils", "graphic_surface:surface", "hilog:libhilog", "player_framework:media_client", ] resource_config_file = "../resources/ohos_test.xml" } ################################################################################################################## ohos_unittest("acodec_native_unit_test") { module_out_path = module_output_path include_dirs = avcodec_unittest_native_include_dirs include_dirs += [ "./", "./acodec_test", ] cflags = avcodec_unittest_cflags if (multimedia_player_framework_support_codec) { sources = [ "./acodec_test/acodec_mock.cpp", "./acodec_test/acodec_unit_test.cpp", "./native/audiodecoder/audiodec_native_mock.cpp", "./native/audioencoder/audioenc_native_mock.cpp", "./native/avcodec_info/avcodec_info_native_mock.cpp", "./native/avcodec_list/avcodec_list_native_mock.cpp", "./native/avcodec_mock_factory.cpp", "./native/avformat/avformat_native_mock.cpp", "./native/avmemory/avmemory_native_mock.cpp", "./native/enum/enum_native_mock.cpp", "./native/surface/surface_native_mock.cpp", ] } deps = [ "../../../../../../foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client", "../../../../../../foundation/window/window_manager/wm:libwm", ] external_deps = [ "c_utils:utils", "graphic_surface:surface", "hilog:libhilog", "player_framework:media_client", ] resource_config_file = "../resources/ohos_test.xml" } ################################################################################################################## ohos_unittest("avcodec_list_native_unit_test") { module_out_path = module_output_path include_dirs = avcodec_unittest_native_include_dirs include_dirs += [ "./", "./avcodec_list_test", ] cflags = avcodec_unittest_cflags if (multimedia_player_framework_support_codec) { sources = [ "./avcodec_list_test/avcodec_list_unit_test.cpp", "./native/avcodec_info/avcodec_info_native_mock.cpp", "./native/avcodec_list/avcodec_list_native_mock.cpp", "./native/avcodec_mock_factory.cpp", "./native/avformat/avformat_native_mock.cpp", "./native/enum/enum_native_mock.cpp", ] } deps = [ "../../../../../../foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client", "../../../../../../foundation/window/window_manager/wm:libwm", ] external_deps = [ "c_utils:utils", "graphic_surface:surface", "hilog:libhilog", "player_framework:media_client", ] resource_config_file = "../resources/ohos_test.xml" } ################################################################################################################## ohos_unittest("format_native_unit_test") { module_out_path = module_output_path include_dirs = avcodec_unittest_native_include_dirs include_dirs += [ "./", "./format_test", ] cflags = avcodec_unittest_cflags if (multimedia_player_framework_support_codec) { sources = [ "./format_test/format_unit_test.cpp", "./native/avcodec_mock_factory.cpp", "./native/avformat/avformat_native_mock.cpp", ] } deps = [ "../../../../../../foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client", "../../../../../../foundation/window/window_manager/wm:libwm", "../../../../../../third_party/bounds_checking_function:libsec_shared", ] external_deps = [ "c_utils:utils", "graphic_surface:surface", "hilog:libhilog", "player_framework:media_client", ] }