diff options
author | Jeffrey Vander Stoep <jeffv@google.com> | 2019-11-14 18:28:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-11-14 18:28:13 +0000 |
commit | f3a2d5abc3b3106a73eb48dc865b5855cb33db42 (patch) | |
tree | 894aa3eb10290a15346dd47e67f2be388a395e62 /rust/rust_test.go | |
parent | 263dcb7397844bd6d4005b8aaffbb01120da85d0 (diff) | |
parent | 51feafad57da137b3476de84e8e9fd8fd3732cb4 (diff) |
Merge changes from topic "rust-sysroot"
* changes:
Enable x86_64 device support
Build Rust Device Sysroots in Soong
Diffstat (limited to 'rust/rust_test.go')
-rw-r--r-- | rust/rust_test.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/rust/rust_test.go b/rust/rust_test.go index 599af098c..91c2f0956 100644 --- a/rust/rust_test.go +++ b/rust/rust_test.go @@ -199,6 +199,25 @@ func TestProcMacroDeviceDeps(t *testing.T) { srcs: ["foo.rs"], crate_name: "bar", } + // 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"], @@ -217,3 +236,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") + } +} |