| # Copyright 2020 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":cargo_gnaw_golden_integration_host_test($host_toolchain)" ] |
| } |
| |
| if (is_host) { |
| host_test("cargo_gnaw_golden_integration_host_test") { |
| binary_path = "$root_out_dir/cargo_gnaw_golden_integration_test" |
| |
| args = [ |
| "--test-base-dir", |
| rebase_path(".", root_build_dir), |
| "--rustc-binary-path", |
| "$out_rustc_prefix/bin/rustc", |
| "--gn-binary-path", |
| rebase_path("//prebuilt/third_party/gn/${host_platform}/gn", |
| root_build_dir), |
| "--cargo-binary-path", |
| "$out_rustc_prefix/bin/cargo", |
| "--lib-path", |
| "$out_rustc_prefix/lib", |
| ] |
| |
| # Host tests are tested on different workers from those the artifacts were |
| # built on. This means, if we want to use binaries from the source tree, |
| # we need to add them to test dependencies explicitly. |
| deps = [ |
| ":cargo_gnaw_golden_integration_test", |
| ":cargo_gnaw_prebuilt_bin_libs", |
| ":cargo_gnaw_tests", |
| "//build/rust:prebuilt_toolchain_host_test_data", |
| ] |
| } |
| |
| rustc_binary("cargo_gnaw_golden_integration_test") { |
| edition = "2021" |
| source_root = "golden.rs" |
| sources = [ "golden.rs" ] |
| deps = [ |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:pretty_assertions", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:walkdir", |
| "//tools/cargo-gnaw:cargo-gnaw-lib", |
| ] |
| } |
| |
| visibility = [ ":*" ] |
| |
| host_test_data("cargo_gnaw_tests") { |
| sources = [ |
| "binary/BUILD.gn", |
| "binary/Cargo.lock", |
| "binary/Cargo.toml", |
| "binary/src/lib.rs", |
| "binary/src/main.rs", |
| "binary_with_tests/BUILD.gn", |
| "binary_with_tests/Cargo.lock", |
| "binary_with_tests/Cargo.toml", |
| "binary_with_tests/src/lib.rs", |
| "binary_with_tests/src/main.rs", |
| "cargo_features/BUILD-all-features.gn", |
| "cargo_features/BUILD-default.gn", |
| "cargo_features/BUILD-featurefoo.gn", |
| "cargo_features/BUILD-no-default-features.gn", |
| "cargo_features/Cargo.lock", |
| "cargo_features/Cargo.toml", |
| "cargo_features/src/lib.rs", |
| "cargo_features/sub-crate-default/Cargo.toml", |
| "cargo_features/sub-crate-default/src/lib.rs", |
| "cargo_features/sub-crate-for-feature/Cargo.toml", |
| "cargo_features/sub-crate-for-feature/src/lib.rs", |
| "cargo_features/sub-crate-non-default/Cargo.toml", |
| "cargo_features/sub-crate-non-default/src/lib.rs", |
| "cargo_features/sub-crate-with-feature/Cargo.toml", |
| "cargo_features/sub-crate-with-feature/src/lib.rs", |
| "feature_review/BUILD.gn", |
| "feature_review/Cargo.lock", |
| "feature_review/Cargo.toml", |
| "feature_review/Cargo_extra_review.toml", |
| "feature_review/Cargo_missing_review.toml", |
| "feature_review/Cargo_unreviewed_feature.toml", |
| "feature_review/crate_with_features/Cargo.toml", |
| "feature_review/crate_with_features/src/lib.rs", |
| "feature_review/needs_feature/Cargo.toml", |
| "feature_review/needs_feature/src/lib.rs", |
| "feature_review/src/lib.rs", |
| "multiple_crate_types/BUILD.gn", |
| "multiple_crate_types/Cargo.lock", |
| "multiple_crate_types/Cargo.toml", |
| "multiple_crate_types/src/lib.rs", |
| "multiple_crate_types/sub-crate-with-cdylib/Cargo.toml", |
| "multiple_crate_types/sub-crate-with-cdylib/src/lib.rs", |
| "multiple_crate_types/sub-crate-with-dylib/Cargo.toml", |
| "multiple_crate_types/sub-crate-with-dylib/src/lib.rs", |
| "multiple_crate_types/sub-crate-with-rlib/Cargo.toml", |
| "multiple_crate_types/sub-crate-with-rlib/src/lib.rs", |
| "platform_deps/.cargo/config", |
| "platform_deps/BUILD.gn", |
| "platform_deps/Cargo.lock", |
| "platform_deps/Cargo.toml", |
| "platform_deps/src/lib.rs", |
| "platform_deps/vendor/anyhow/.cargo-checksum.json", |
| "platform_deps/vendor/anyhow/Cargo.toml", |
| "platform_deps/vendor/anyhow/LICENSE-APACHE", |
| "platform_deps/vendor/anyhow/LICENSE-MIT", |
| "platform_deps/vendor/anyhow/README.md", |
| "platform_deps/vendor/anyhow/build.rs", |
| "platform_deps/vendor/anyhow/src/backtrace.rs", |
| "platform_deps/vendor/anyhow/src/chain.rs", |
| "platform_deps/vendor/anyhow/src/context.rs", |
| "platform_deps/vendor/anyhow/src/error.rs", |
| "platform_deps/vendor/anyhow/src/fmt.rs", |
| "platform_deps/vendor/anyhow/src/kind.rs", |
| "platform_deps/vendor/anyhow/src/lib.rs", |
| "platform_deps/vendor/anyhow/src/macros.rs", |
| "platform_deps/vendor/anyhow/src/wrapper.rs", |
| "platform_deps/vendor/anyhow/tests/common/mod.rs", |
| "platform_deps/vendor/anyhow/tests/compiletest.rs", |
| "platform_deps/vendor/anyhow/tests/drop/mod.rs", |
| "platform_deps/vendor/anyhow/tests/test_autotrait.rs", |
| "platform_deps/vendor/anyhow/tests/test_backtrace.rs", |
| "platform_deps/vendor/anyhow/tests/test_boxed.rs", |
| "platform_deps/vendor/anyhow/tests/test_chain.rs", |
| "platform_deps/vendor/anyhow/tests/test_context.rs", |
| "platform_deps/vendor/anyhow/tests/test_convert.rs", |
| "platform_deps/vendor/anyhow/tests/test_downcast.rs", |
| "platform_deps/vendor/anyhow/tests/test_fmt.rs", |
| "platform_deps/vendor/anyhow/tests/test_macros.rs", |
| "platform_deps/vendor/anyhow/tests/test_repr.rs", |
| "platform_deps/vendor/anyhow/tests/test_source.rs", |
| "platform_deps/vendor/anyhow/tests/ui/no-impl.rs", |
| "platform_deps/vendor/anyhow/tests/ui/no-impl.stderr", |
| "platform_features/BUILD.gn", |
| "platform_features/Cargo.lock", |
| "platform_features/Cargo.toml", |
| "platform_features/a/Cargo.toml", |
| "platform_features/a/src/lib.rs", |
| "platform_features/b/Cargo.toml", |
| "platform_features/b/src/lib.rs", |
| "platform_features/src/lib.rs", |
| "sdk_metadata/BUILD.gn", |
| "sdk_metadata/Cargo.lock", |
| "sdk_metadata/Cargo.toml", |
| "sdk_metadata/sdk_metas/sdk_metadata.sdk.meta.json", |
| "sdk_metadata/src/lib.rs", |
| "sdk_metadata/sub-crate-proc-macro/Cargo.toml", |
| "sdk_metadata/sub-crate-proc-macro/src/lib.rs", |
| "sdk_metadata/sub-crate/Cargo.toml", |
| "sdk_metadata/sub-crate/src/lib.rs", |
| "simple/BUILD.gn", |
| "simple/Cargo.lock", |
| "simple/Cargo.toml", |
| "simple/src/lib.rs", |
| "simple_deps/.cargo/config", |
| "simple_deps/BUILD.gn", |
| "simple_deps/BUILD_WITH_NO_ROOT.gn", |
| "simple_deps/Cargo.lock", |
| "simple_deps/Cargo.toml", |
| "simple_deps/src/lib.rs", |
| "simple_deps/vendor/anyhow/.cargo-checksum.json", |
| "simple_deps/vendor/anyhow/Cargo.toml", |
| "simple_deps/vendor/anyhow/LICENSE-APACHE", |
| "simple_deps/vendor/anyhow/LICENSE-MIT", |
| "simple_deps/vendor/anyhow/README.md", |
| "simple_deps/vendor/anyhow/build.rs", |
| "simple_deps/vendor/anyhow/src/LICENSE-FOR-TESTING", |
| "simple_deps/vendor/anyhow/src/backtrace.rs", |
| "simple_deps/vendor/anyhow/src/chain.rs", |
| "simple_deps/vendor/anyhow/src/context.rs", |
| "simple_deps/vendor/anyhow/src/error.rs", |
| "simple_deps/vendor/anyhow/src/fmt.rs", |
| "simple_deps/vendor/anyhow/src/kind.rs", |
| "simple_deps/vendor/anyhow/src/lib.rs", |
| "simple_deps/vendor/anyhow/src/macros.rs", |
| "simple_deps/vendor/anyhow/src/wrapper.rs", |
| "simple_deps/vendor/anyhow/tests/common/mod.rs", |
| "simple_deps/vendor/anyhow/tests/compiletest.rs", |
| "simple_deps/vendor/anyhow/tests/drop/mod.rs", |
| "simple_deps/vendor/anyhow/tests/test_autotrait.rs", |
| "simple_deps/vendor/anyhow/tests/test_backtrace.rs", |
| "simple_deps/vendor/anyhow/tests/test_boxed.rs", |
| "simple_deps/vendor/anyhow/tests/test_chain.rs", |
| "simple_deps/vendor/anyhow/tests/test_context.rs", |
| "simple_deps/vendor/anyhow/tests/test_convert.rs", |
| "simple_deps/vendor/anyhow/tests/test_downcast.rs", |
| "simple_deps/vendor/anyhow/tests/test_fmt.rs", |
| "simple_deps/vendor/anyhow/tests/test_macros.rs", |
| "simple_deps/vendor/anyhow/tests/test_repr.rs", |
| "simple_deps/vendor/anyhow/tests/test_source.rs", |
| "simple_deps/vendor/anyhow/tests/ui/no-impl.rs", |
| "simple_deps/vendor/anyhow/tests/ui/no-impl.stderr", |
| "target_renaming/BUILD.gn", |
| "target_renaming/Cargo.lock", |
| "target_renaming/Cargo.toml", |
| "target_renaming/example_lib/Cargo.toml", |
| "target_renaming/example_lib/src/lib.rs", |
| "target_renaming/src/lib.rs", |
| "testonly/BUILD.gn", |
| "testonly/Cargo.lock", |
| "testonly/Cargo.toml", |
| "testonly/example_lib/Cargo.toml", |
| "testonly/example_lib/src/lib.rs", |
| "testonly/src/lib.rs", |
| "visibility/BUILD.gn", |
| "visibility/Cargo.lock", |
| "visibility/Cargo.toml", |
| "visibility/example_lib/Cargo.toml", |
| "visibility/example_lib/src/lib.rs", |
| "visibility/src/lib.rs", |
| ] |
| } |
| |
| host_test_data("cargo_gnaw_prebuilt_bin_libs") { |
| sources = [ "//prebuilt/third_party/gn/${host_platform}/gn" ] |
| } |
| } |