Clean up rust tests.

The list of required deps for testing is a lot shorter as we no longer
include as many prebuilt libraries and our list of stdlibs is much
shorter. Remove the libraries we no longer need, and add the
non-prebuilt libstd and libtest to the deps generated for every test.

Bug: 153463188
Test: Soong tests pass.
Change-Id: I94f7b514797ab8d6aedb543ea6afdb07611b7293
This commit is contained in:
Ivan Lozano
2020-04-09 09:32:15 -04:00
parent 14f42d34af
commit 2f15bae336
2 changed files with 25 additions and 59 deletions

View File

@@ -215,25 +215,6 @@ 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"],

View File

@@ -21,51 +21,11 @@ import (
func GatherRequiredDepsForTest() string {
bp := `
rust_prebuilt_dylib {
name: "libarena_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libfmt_macros_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libgraphviz_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libserialize_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libstd_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libsyntax_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libsyntax_ext_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libsyntax_pos_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libterm_x86_64-unknown-linux-gnu",
srcs: [""],
host_supported: true,
}
rust_prebuilt_dylib {
name: "libtest_x86_64-unknown-linux-gnu",
srcs: [""],
@@ -81,6 +41,31 @@ func GatherRequiredDepsForTest() string {
nocrt: true,
system_shared_libs: [],
}
rust_library_dylib {
name: "libstd",
crate_name: "std",
srcs: ["foo.rs"],
no_stdlibs: true,
}
rust_library_rlib {
name: "libstd.static",
crate_name: "std",
srcs: ["foo.rs"],
no_stdlibs: true,
}
rust_library_dylib {
name: "libtest",
crate_name: "test",
srcs: ["foo.rs"],
no_stdlibs: true,
}
rust_library_rlib {
name: "libtest.static",
crate_name: "test",
srcs: ["foo.rs"],
no_stdlibs: true,
}
` + cc.GatherRequiredDepsForTest(android.NoOsType)
return bp
}