Move test data installation to Soong

To generate module-info.json in Soong for b/309006256 Soong needs to
know the test data paths. Moving test data installation into Soong will
also help later for test suite packaging.

Add ModuleContext.InstallTestData that installs the files listed in a
[]DataPath alongside the test.  The files will also be passed to Make
to allow it to continue packaging them into the test suites for now.

Update the module types that are producing LOCAL_TEST_DATA entries
in their Android.mk files to go through InstallTestData instead.

Bug: 311428265
Test: atest --host toybox-gtests --test-timeout=120000
Change-Id: Ia8b964f86e584ea464667fd86a48d754d118bead
This commit is contained in:
Colin Cross
2023-11-15 12:39:40 -08:00
parent 312634eb0f
commit 5c1d5fb21b
17 changed files with 165 additions and 161 deletions

View File

@@ -50,7 +50,14 @@ func buildLicenseMetadata(ctx ModuleContext, licenseMetadataFile WritablePath) {
outputFiles = PathsIfNonNil(outputFiles...)
}
isContainer := isContainerFromFileExtensions(base.installFiles, outputFiles)
// Only pass the last installed file to isContainerFromFileExtensions so a *.zip file in test data
// doesn't mark the whole module as a container.
var installFiles InstallPaths
if len(base.installFiles) > 0 {
installFiles = InstallPaths{base.installFiles[len(base.installFiles)-1]}
}
isContainer := isContainerFromFileExtensions(installFiles, outputFiles)
var allDepMetadataFiles Paths
var allDepMetadataArgs []string