| # Copyright 2018 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components.gni") |
| import("//build/components/fuchsia_unittest_package.gni") |
| |
| source_set("factory_source") { |
| sources = [ |
| "codec_factory_app.cc", |
| "codec_factory_app.h", |
| "codec_factory_hw_policy.cc", |
| "codec_factory_hw_policy.h", |
| "codec_factory_hw_policy_astro.cc", |
| "codec_factory_hw_policy_astro.h", |
| "codec_factory_impl.cc", |
| "codec_factory_impl.h", |
| "codec_factory_policy.cc", |
| "codec_factory_policy.h", |
| "codec_isolate.cc", |
| "codec_isolate.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_hlcpp", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_hlcpp", |
| "//sdk/fidl/fuchsia.gpu.magma:fuchsia.gpu.magma_hlcpp", |
| "//sdk/fidl/fuchsia.hardware.mediacodec:fuchsia.hardware.mediacodec_hlcpp", |
| "//sdk/fidl/fuchsia.media:fuchsia.media_hlcpp", |
| "//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec_hlcpp", |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_hlcpp", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_hlcpp", |
| "//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo_hlcpp", |
| "//sdk/lib/inspect/component/cpp", |
| "//sdk/lib/svc", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/trace-provider", |
| ] |
| |
| deps = [ "//sdk/lib/vfs/cpp" ] |
| } |
| |
| fuchsia_component("component") { |
| manifest = "meta/codec_factory.cml" |
| deps = [ ":factory" ] |
| component_name = "codec_factory" |
| } |
| |
| executable("factory") { |
| output_name = "codec_factory" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ ":factory_source" ] |
| } |
| |
| executable("codec_detect_hw_encode_test_bin") { |
| output_name = "codec_detect_hw_encode_test" |
| |
| testonly = true |
| |
| sources = [ "test/codec_detect_hw_encode_test.cc" ] |
| |
| deps = [ |
| ":factory_source", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| executable("codec_detect_hw_decode_test_bin") { |
| output_name = "codec_detect_hw_decode_test" |
| |
| testonly = true |
| |
| sources = [ "test/codec_detect_hw_decode_test.cc" ] |
| |
| deps = [ |
| ":factory_source", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| |
| # TODO(https://fxbug.dev/42077218): Temporarily disable lsan for this target. Reenable once all leaks are fixed. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| fuchsia_test_component("codec_detect_hw_encode") { |
| manifest = "meta/codec_detect_hw_encode_test.cml" |
| deps = [ ":codec_detect_hw_encode_test_bin" ] |
| test_type = "system" |
| } |
| |
| fuchsia_test_component("codec_detect_hw_decode") { |
| manifest = "meta/codec_detect_hw_decode_test.cml" |
| deps = [ ":codec_detect_hw_decode_test_bin" ] |
| test_type = "system" |
| } |
| |
| fuchsia_test_package("codec_detect_hw_decode_test") { |
| test_components = [ ":codec_detect_hw_decode" ] |
| test_specs = { |
| # test depends on hw decoder device being present |
| environments = [ |
| sherlock_env, |
| astro_env, |
| vim3_env, |
| ] |
| } |
| } |
| |
| fuchsia_test_package("codec_detect_hw_encode_test") { |
| test_components = [ ":codec_detect_hw_encode" ] |
| test_specs = { |
| # test depends on hw encoder device being present |
| environments = [ sherlock_env ] |
| } |
| } |
| |
| executable("codec_factory_integration_test_exe") { |
| output_name = "codec_factory_integration_test" |
| testonly = true |
| |
| sources = [ "test/codec_factory_integration_test.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.gpu.magma:fuchsia.gpu.magma_hlcpp", |
| "//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec_hlcpp", |
| "//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo_hlcpp", |
| "//sdk/lib/sys/component/cpp/testing:cpp", |
| "//sdk/lib/vfs/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//src/storage/lib/vfs/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| executable("fake_codec_factory_bin") { |
| testonly = true |
| output_name = "fake_codec_factory" |
| |
| sources = [ "test/fake_codec_factory.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.gpu.magma:fuchsia.gpu.magma_hlcpp", |
| "//sdk/fidl/fuchsia.media:fuchsia.media_hlcpp", |
| "//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec_hlcpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl:fxl_cli", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("fake_codec_factory") { |
| testonly = true |
| component_name = "fake_codec_factory" |
| deps = [ ":fake_codec_factory_bin" ] |
| |
| manifest = "meta/fake_codec_factory.cml" |
| } |
| |
| fuchsia_unittest_package("codec_factory_integration_test") { |
| deps = [ |
| ":codec_factory_integration_test_exe", |
| ":component", |
| ":fake_codec_factory", |
| ] |
| manifest = "meta/codec_factory_integration_test.cml" |
| } |