| // Copyright 2023 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. |
| |
| // This shard should be used when writing CTF tests in Rust. This shard will add |
| // two subpackages to your component hierarchy, ensuring that the test runner and |
| // the Rust test are always compatible. Rust test components should be started in |
| // the #subpackaged-runner-env. |
| // |
| // The following subpackages need to be added to the test's |
| // ctf_fuchsia_package definition: |
| // |
| // subpackages = [ |
| // "//src/sys/test_runners/lib_loader_cache:lib_loader_runner_cache", |
| // "//src/sys/test_runners/rust:rust-test-runner", |
| // ] |
| { |
| children: [ |
| { |
| name: "subpackaged_rust_test_runner", |
| url: "rust-test-runner#meta/rust-test-runner.cm", |
| }, |
| { |
| name: "lib_loader_cache", |
| url: "lib_loader_runner_cache#meta/lib_loader_runner_cache.cm", |
| }, |
| ], |
| offer: [ |
| { |
| protocol: "fuchsia.process.Launcher", |
| from: "parent", |
| to: "#subpackaged_rust_test_runner", |
| }, |
| { |
| protocol: "fuchsia.test.runner.LibraryLoaderCacheBuilder", |
| from: "#lib_loader_cache", |
| to: "#subpackaged_rust_test_runner", |
| }, |
| { |
| protocol: "fuchsia.inspect.InspectSink", |
| from: "parent", |
| to: [ |
| "#lib_loader_cache", |
| "#subpackaged_rust_test_runner", |
| ], |
| }, |
| ], |
| environments: [ |
| { |
| name: "subpackaged-runner-env", |
| extends: "realm", |
| runners: [ |
| { |
| runner: "rust_test_runner", |
| from: "#subpackaged_rust_test_runner", |
| }, |
| ], |
| }, |
| ], |
| } |