Extract failIfErrored() to android/testing.go
Bug: 74506774 Test: lunch aosp_walleye-userdebug && make # runs unit tests Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
This commit is contained in:
@@ -135,9 +135,9 @@ func TestDataTests(t *testing.T) {
|
||||
ctx.Register()
|
||||
|
||||
_, errs := ctx.ParseBlueprintsFiles("Blueprints")
|
||||
fail(t, errs)
|
||||
android.FailIfErrored(t, errs)
|
||||
_, errs = ctx.PrepareBuildActions(config)
|
||||
fail(t, errs)
|
||||
android.FailIfErrored(t, errs)
|
||||
|
||||
foo := ctx.ModuleForTests("foo", "")
|
||||
|
||||
@@ -186,12 +186,3 @@ func (test *testDataTest) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
func (test *testDataTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
test.data = ctx.ExpandSources(test.Properties.Data, nil)
|
||||
}
|
||||
|
||||
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