blob: 4d3907ea84d7d0799daa99be1eca9aa8c3695ef1 [file] [log] [blame]
# Copyright 2021 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/rust/rustc_test.gni")
import("//tools/cmc/build/cmc.gni")
fshost_integration_test_deps = [
"//sdk/fidl/fuchsia.boot:fuchsia.boot-rustc",
"//sdk/fidl/fuchsia.fshost:fuchsia.fshost-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.logger:fuchsia.logger-rustc",
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-component-test",
"//src/lib/storage/vfs/rust:vfs",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//src/sys/lib/component-events",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
]
fshost_integration_test_sources = [
"src/main.rs",
"src/mocks.rs",
]
rustc_test("fshost_cpp_integration_test") {
edition = "2021"
source_root = "src/main.rs"
features = [ "fshost_cpp" ]
sources = fshost_integration_test_sources
deps = fshost_integration_test_deps
}
rustc_test("fshost_rust_integration_test") {
edition = "2021"
source_root = "src/main.rs"
features = [ "fshost_rust" ]
sources = fshost_integration_test_sources
deps = fshost_integration_test_deps
}
cmc_merge("fshost_cpp_integration_test.cml") {
sources = [
"meta/fshost_cpp_program.cml",
"meta/fshost_integration_test.cml",
]
}
cmc_merge("fshost_rust_integration_test.cml") {
sources = [
"meta/fshost_integration_test.cml",
"meta/fshost_rust_program.cml",
]
}
fuchsia_test_component("fshost_cpp_integration_test_component") {
component_name = "fshost_cpp_integration_test_component"
manifest_outputs = get_target_outputs(":fshost_cpp_integration_test.cml")
manifest = manifest_outputs[0]
deps = [ ":fshost_cpp_integration_test" ]
manifest_deps = [ ":fshost_cpp_integration_test.cml" ]
}
fuchsia_test_component("fshost_rust_integration_test_component") {
component_name = "fshost_rust_integration_test_component"
manifest_outputs = get_target_outputs(":fshost_rust_integration_test.cml")
manifest = manifest_outputs[0]
deps = [ ":fshost_rust_integration_test" ]
manifest_deps = [ ":fshost_rust_integration_test.cml" ]
}
cmc_merge("test-fshost-rust.cml") {
sources = [
"//src/storage/fshost/meta/base_fshost.cml",
"//src/storage/fshost/meta/core_fshost.cml",
"//src/storage/fshost/meta/rust_fshost.cml",
]
}
fuchsia_component("test-fshost-rust") {
testonly = true
manifest_outputs = get_target_outputs(":test-fshost-rust.cml")
manifest = manifest_outputs[0]
manifest_deps = [ ":test-fshost-rust.cml" ]
deps = [ "..:fshost-rust" ]
}
fuchsia_test_package("fshost_integration_tests") {
test_components = [
":fshost_cpp_integration_test_component",
":fshost_rust_integration_test_component",
]
deps = [
":fshost_cpp_integration_test_component",
":fshost_rust_integration_test_component",
":test-fshost-rust",
"//src/storage/fshost/testing:test-fshost",
]
}
group("tests") {
testonly = true
deps = [ ":fshost_integration_tests" ]
}