summaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
author Liz Kammer <eakammer@google.com> 2020-05-12 15:26:55 -0700
committer Liz Kammer <eakammer@google.com> 2020-05-13 10:17:30 -0700
commit1c14a21994da900427d9d2a26ac9ef3a3ea4c066 (patch)
treeb2626e8812d1061c6c55a1877ab30473d5b57f6e /apex/apex_test.go
parentc81f967ddd52fac128a7f6404cf46a2e6946688d (diff)
Add test data dependencies to APEX.
Test: soong go tests Bug: 155820504 Change-Id: If96d82c27f19953e34efb31f2111f1643c0c4008
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index dc6986244..021c3e22a 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -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")