summaryrefslogtreecommitdiff
path: root/rust/rust_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/rust_test.go')
-rw-r--r--rust/rust_test.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/rust/rust_test.go b/rust/rust_test.go
index eb04e7257..bbd911114 100644
--- a/rust/rust_test.go
+++ b/rust/rust_test.go
@@ -209,6 +209,25 @@ func TestProcMacroDeviceDeps(t *testing.T) {
name: "libbar",
srcs: ["foo.rs"],
}
+ // Make a dummy libstd to let resolution go through
+ rust_library_dylib {
+ name: "libstd",
+ crate_name: "std",
+ srcs: ["foo.rs"],
+ no_stdlibs: true,
+ }
+ rust_library_dylib {
+ name: "libterm",
+ crate_name: "term",
+ srcs: ["foo.rs"],
+ no_stdlibs: true,
+ }
+ rust_library_dylib {
+ name: "libtest",
+ crate_name: "test",
+ srcs: ["foo.rs"],
+ no_stdlibs: true,
+ }
rust_proc_macro {
name: "libpm",
rlibs: ["libbar"],
@@ -226,3 +245,18 @@ func TestProcMacroDeviceDeps(t *testing.T) {
t.Errorf("Proc_macro is not using host variant of dependent modules.")
}
}
+
+// Test that no_stdlibs suppresses dependencies on rust standard libraries
+func TestNoStdlibs(t *testing.T) {
+ ctx := testRust(t, `
+ rust_binary {
+ name: "fizz-buzz",
+ srcs: ["foo.rs"],
+ no_stdlibs: true,
+ }`)
+ module := ctx.ModuleForTests("fizz-buzz", "android_arm64_armv8-a_core").Module().(*Module)
+
+ if android.InList("libstd", module.Properties.AndroidMkDylibs) {
+ t.Errorf("no_stdlibs did not suppress dependency on libstd")
+ }
+}