Extract failIfErrored() to android/testing.go
Bug: 74506774 Test: lunch aosp_walleye-userdebug && make # runs unit tests Merged-In: I1c09412d5988dca2cc1c5f041893b313ab1c163a Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
This commit is contained in:
@@ -138,9 +138,9 @@ func TestPrebuilts(t *testing.T) {
|
||||
})
|
||||
|
||||
_, errs := ctx.ParseBlueprintsFiles("Blueprints")
|
||||
fail(t, errs)
|
||||
FailIfErrored(t, errs)
|
||||
_, errs = ctx.PrepareBuildActions(config)
|
||||
fail(t, errs)
|
||||
FailIfErrored(t, errs)
|
||||
|
||||
foo := ctx.ModuleForTests("foo", "")
|
||||
|
||||
@@ -231,12 +231,3 @@ func (s *sourceModule) DepsMutator(ctx BottomUpMutatorContext) {
|
||||
|
||||
func (s *sourceModule) GenerateAndroidBuildActions(ctx ModuleContext) {
|
||||
}
|
||||
|
||||
func fail(t *testing.T, errs []error) {
|
||||
if len(errs) > 0 {
|
||||
for _, err := range errs {
|
||||
t.Error(err)
|
||||
}
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user