blob: f7a9e25a7415c368bec9bf4fb36e9546388a8a6c [file] [log] [blame]
# Copyright 2019 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/config.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
group("test") {
testonly = true
deps = [
":audio_decoder_test",
":audio_encoder_test",
":h264_decoder_test",
":h264_encoder_test",
":h265-encoder-test",
":stream_processor_lib_test",
":video-frame-stream-test",
":video_frame_hasher_test",
]
}
rustc_library("stream_processor_test_lib") {
name = "stream_processor_test"
edition = "2018"
testonly = true
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fidl_table_validation",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/mundane",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/media/stream_processors/fuchsia-stream-processors",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/buffer_collection_constraints.rs",
"src/buffer_set.rs",
"src/elementary_stream.rs",
"src/input_packet_stream.rs",
"src/lib.rs",
"src/log_macros.rs",
"src/output_validator.rs",
"src/stream.rs",
"src/stream_runner.rs",
"src/test_spec.rs",
]
}
test_package("stream_processor_lib_test") {
deps = [ ":stream_processor_test_lib_test" ]
tests = [
{
name = "stream_processor_test_lib_test"
environments = basic_envs
},
]
}
rustc_library("stream_processor_decoder_factory_lib") {
name = "stream_processor_decoder_factory"
edition = "2018"
source_root = "stream_processor_factories/decoders.rs"
testonly = true
deps = [
":stream_processor_test_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
]
sources = [ "stream_processor_factories/decoders.rs" ]
}
rustc_library("stream_processor_encoder_factory_lib") {
name = "stream_processor_encoder_factory"
edition = "2018"
source_root = "stream_processor_factories/encoders.rs"
testonly = true
deps = [
":stream_processor_test_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:thiserror",
]
sources = [ "stream_processor_factories/encoders.rs" ]
}
rustc_test("audio_decoder_test_bin") {
name = "audio_decoder_test"
edition = "2018"
source_root = "audio_decoder_test/lib.rs"
deps = [
":stream_processor_decoder_factory_lib",
":stream_processor_test_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/mundane",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:bitfield",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:thiserror",
]
sources = [
"audio_decoder_test/lib.rs",
"audio_decoder_test/sbc.rs",
"audio_decoder_test/test_suite.rs",
]
}
test_package("audio_decoder_test") {
deps = [ ":audio_decoder_test_bin" ]
tests = [
{
name = "audio_decoder_test"
environments = basic_envs
},
]
resources = [
{
path = rebase_path("audio_decoder_test/test_data/s16le44100mono.sbc")
dest = "s16le44100mono.sbc"
},
]
}
rustc_test("audio_encoder_test_bin") {
name = "audio_encoder_test"
edition = "2018"
source_root = "audio_encoder_test/lib.rs"
deps = [
":stream_processor_encoder_factory_lib",
":stream_processor_test_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/mundane",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:thiserror",
]
sources = [
"audio_encoder_test/lib.rs",
"audio_encoder_test/pcm_audio.rs",
"audio_encoder_test/test_suite.rs",
"audio_encoder_test/timestamp_validator.rs",
]
}
test_package("audio_encoder_test") {
deps = [ ":audio_encoder_test_bin" ]
tests = [
{
name = "audio_encoder_test"
environments = basic_envs
},
]
}
rustc_library("video_frame_hasher_lib") {
name = "video_frame_hasher"
edition = "2018"
with_unit_tests = true
testonly = true
source_root = "video_frame_hasher/lib.rs"
deps = [
":stream_processor_test_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/mundane",
"//src/media/stream_processors/fuchsia-stream-processors",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:thiserror",
]
sources = [ "video_frame_hasher/lib.rs" ]
}
test_package("video_frame_hasher_test") {
deps = [ ":video_frame_hasher_lib_test" ]
tests = [
{
name = "video_frame_hasher_lib_test"
environments = basic_envs
},
]
}
rustc_library("video_frame_stream_lib") {
name = "video_frame_stream"
edition = "2018"
with_unit_tests = true
testonly = true
source_root = "video_frame_stream/lib.rs"
deps = [
":stream_processor_test_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
]
sources = [ "video_frame_stream/lib.rs" ]
}
test_package("video-frame-stream-test") {
deps = [ ":video_frame_stream_lib_test" ]
tests = [
{
name = "video_frame_stream_lib_test"
environments = basic_envs
},
]
}
rustc_test("h264_decoder_test_bin") {
name = "h264_decoder_test"
edition = "2018"
source_root = "h264_decoder_test/lib.rs"
deps = [
":stream_processor_decoder_factory_lib",
":stream_processor_test_lib",
":video_frame_hasher_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/syslog/rust:syslog",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:thiserror",
]
sources = [
"h264_decoder_test/h264.rs",
"h264_decoder_test/lib.rs",
]
}
test_package("h264_decoder_test") {
deps = [ ":h264_decoder_test_bin" ]
tests = [
{
name = "h264_decoder_test"
environments = basic_envs
},
]
resources = [
{
path = rebase_path(
"../../../../garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
rustc_test("h264_encoder_test_bin") {
name = "h264_encoder_test"
edition = "2018"
source_root = "h264_encoder_test/lib.rs"
deps = [
":stream_processor_decoder_factory_lib",
":stream_processor_encoder_factory_lib",
":stream_processor_test_lib",
":video_frame_stream_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
]
sources = [
"h264_encoder_test/h264.rs",
"h264_encoder_test/lib.rs",
"h264_encoder_test/test_suite.rs",
]
}
test_package("h264_encoder_test") {
deps = [ ":h264_encoder_test_bin" ]
tests = [
{
name = "h264_encoder_test"
environments = [ sherlock_env ]
},
]
}
rustc_test("h265_encoder_test_bin") {
name = "h265_encoder_test"
edition = "2018"
source_root = "h265_encoder_test/lib.rs"
deps = [
":stream_processor_decoder_factory_lib",
":stream_processor_encoder_factory_lib",
":stream_processor_test_lib",
":video_frame_stream_lib",
"//sdk/fidl/fuchsia.media:fuchsia.media-rustc",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:lazy_static",
"//third_party/rust_crates:log",
]
sources = [
"h265_encoder_test/h265.rs",
"h265_encoder_test/lib.rs",
"h265_encoder_test/test_suite.rs",
]
}
test_package("h265-encoder-test") {
deps = [ ":h265_encoder_test_bin" ]
tests = [
{
name = "h265_encoder_test"
environments = [ sherlock_env ]
},
]
}