From b8b0982265b15adcfc703d11428f4a7094f0fa94 Mon Sep 17 00:00:00 2001 From: William Smith Date: Sun, 26 Feb 2023 21:56:35 -0800 Subject: [PATCH] add rust_crate_group test --- test/rust_crate_group/BUILD.bazel | 28 ++++++++++++++++++++++++++++ test/rust_crate_group/dep1.rs | 1 + test/rust_crate_group/dep2.rs | 1 + test/rust_crate_group/lib.rs | 4 ++++ 4 files changed, 34 insertions(+) create mode 100644 test/rust_crate_group/BUILD.bazel create mode 100644 test/rust_crate_group/dep1.rs create mode 100644 test/rust_crate_group/dep2.rs create mode 100644 test/rust_crate_group/lib.rs diff --git a/test/rust_crate_group/BUILD.bazel b/test/rust_crate_group/BUILD.bazel new file mode 100644 index 0000000000..8fe7bc1d20 --- /dev/null +++ b/test/rust_crate_group/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_rust//rust:defs.bzl", "rust_crate_group", "rust_library") + +rust_library( + name = "dep1", + srcs = ["dep1.rs"], + edition = "2021", +) + +rust_library( + name = "dep2", + srcs = ["dep2.rs"], + edition = "2021", +) + +rust_crate_group( + name = "dep1_and_2", + deps = [ + ":dep1", + ":dep2", + ], +) + +rust_library( + name = "test", + srcs = ["lib.rs"], + edition = "2021", + deps = [":dep1_and_2"], +) diff --git a/test/rust_crate_group/dep1.rs b/test/rust_crate_group/dep1.rs new file mode 100644 index 0000000000..93a83e7507 --- /dev/null +++ b/test/rust_crate_group/dep1.rs @@ -0,0 +1 @@ +pub fn dep1() {} diff --git a/test/rust_crate_group/dep2.rs b/test/rust_crate_group/dep2.rs new file mode 100644 index 0000000000..40a6363dda --- /dev/null +++ b/test/rust_crate_group/dep2.rs @@ -0,0 +1 @@ +pub fn dep2() {} diff --git a/test/rust_crate_group/lib.rs b/test/rust_crate_group/lib.rs new file mode 100644 index 0000000000..52f7709dbb --- /dev/null +++ b/test/rust_crate_group/lib.rs @@ -0,0 +1,4 @@ +fn _test() { + dep1::dep1(); + dep2::dep2(); +}