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:
Logan Chien
2018-03-12 16:29:17 +08:00
parent 3985402d74
commit d44aa3b5c8
7 changed files with 22 additions and 66 deletions

View File

@@ -628,7 +628,7 @@ func setupTestExpectErrs(bps map[string]string) (ctx *TestContext, errs []error)
func setupTest(t *testing.T, bps map[string]string) (ctx *TestContext) {
ctx, errs := setupTestExpectErrs(bps)
failIfErrored(t, errs)
FailIfErrored(t, errs)
return ctx
}
@@ -692,12 +692,3 @@ func newTestModule() Module {
InitAndroidModule(m)
return m
}
func failIfErrored(t *testing.T, errs []error) {
if len(errs) > 0 {
for _, err := range errs {
t.Error(err)
}
t.FailNow()
}
}