Extract failIfErrored() to android/testing.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make # runs unit tests
Merged-In: I1c09412d5988dca2cc1c5f041893b313ab1c163a
Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
diff --git a/python/python_test.go b/python/python_test.go
index 176c6ec..ad80167 100644
--- a/python/python_test.go
+++ b/python/python_test.go
@@ -347,7 +347,7 @@
ctx.Register()
ctx.MockFileSystem(d.mockFiles)
_, testErrs := ctx.ParseBlueprintsFiles(bpFile)
- fail(t, testErrs)
+ android.FailIfErrored(t, testErrs)
_, actErrs := ctx.PrepareBuildActions(config)
if len(actErrs) > 0 {
testErrs = append(testErrs, expectErrors(t, actErrs, d.errors)...)
@@ -360,7 +360,7 @@
e.parSpec, e.depsParSpecs)...)
}
}
- fail(t, testErrs)
+ android.FailIfErrored(t, testErrs)
})
}
}
@@ -458,12 +458,3 @@
func tearDownBuildEnv(buildDir string) {
os.RemoveAll(buildDir)
}
-
-func fail(t *testing.T, errs []error) {
- if len(errs) > 0 {
- for _, err := range errs {
- t.Error(err)
- }
- t.FailNow()
- }
-}