Add test data dependencies to APEX.

Test: soong go tests

Bug: 155820504
Change-Id: If96d82c27f19953e34efb31f2111f1643c0c4008
This commit is contained in:
Liz Kammer
2020-05-12 15:26:55 -07:00
parent c81f967ddd
commit 1c14a21994
7 changed files with 61 additions and 3 deletions

View File

@@ -180,6 +180,8 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr
"build/make/core/proguard.flags": nil,
"build/make/core/proguard_basic_keeps.flags": nil,
"dummy.txt": nil,
"baz": nil,
"bar/baz": nil,
}
cc.GatherRequiredFilesForTest(fs)
@@ -3267,6 +3269,14 @@ func TestApexWithTests(t *testing.T) {
private_key: "testkey.pem",
}
filegroup {
name: "fg",
srcs: [
"baz",
"bar/baz"
],
}
cc_test {
name: "mytest",
gtest: false,
@@ -3276,6 +3286,7 @@ func TestApexWithTests(t *testing.T) {
system_shared_libs: [],
static_executable: true,
stl: "none",
data: [":fg"],
}
cc_library {
@@ -3308,6 +3319,10 @@ func TestApexWithTests(t *testing.T) {
ensureContains(t, copyCmds, "image.apex/bin/test/mytest")
ensureContains(t, copyCmds, "image.apex/lib64/mylib.so")
//Ensure that test data are copied into apex.
ensureContains(t, copyCmds, "image.apex/bin/test/baz")
ensureContains(t, copyCmds, "image.apex/bin/test/bar/baz")
// Ensure that test deps built with `test_per_src` are copied into apex.
ensureContains(t, copyCmds, "image.apex/bin/test/mytest1")
ensureContains(t, copyCmds, "image.apex/bin/test/mytest2")