From 1c14a21994da900427d9d2a26ac9ef3a3ea4c066 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Tue, 12 May 2020 15:26:55 -0700 Subject: Add test data dependencies to APEX. Test: soong go tests Bug: 155820504 Change-Id: If96d82c27f19953e34efb31f2111f1643c0c4008 --- apex/apex_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'apex/apex_test.go') 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") -- cgit v1.2.3-59-g8ed1b