Make OutputFileForModule work for AllowMissingDependencies

Report missing output files as missing dependencies when
AllowMissingDependencies is enabled.  This will fix
AllowMissingDependencies builds where a dependency module is
present but missing support for a specific architecture.

Bug: 250918230
Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true nothing
Test: TestOutputFileForModule
Change-Id: I95e96e3e7cb3df7bf678ed628b45baf659addbad
This commit is contained in:
Colin Cross
2022-10-03 21:02:27 -07:00
parent a2aaa2fdef
commit 14ec66c2fb
3 changed files with 130 additions and 9 deletions

View File

@@ -15,10 +15,32 @@
package android
import (
"io/ioutil"
"os"
"testing"
)
func TestMain(m *testing.M) {
os.Exit(m.Run())
var buildDir string
func setUp() {
var err error
buildDir, err = ioutil.TempDir("", "android_test")
if err != nil {
panic(err)
}
}
func tearDown() {
os.RemoveAll(buildDir)
}
func TestMain(m *testing.M) {
run := func() int {
setUp()
defer tearDown()
return m.Run()
}
os.Exit(run())
}