aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorLogan Chien <loganchien@google.com>2018-03-12 16:29:17 +0800
committerLogan Chien <loganchien@google.com>2018-03-16 17:45:42 +0800
commitd44aa3b5c8afbfeb66e39668bab3ec0fac63f1e6 (patch)
treef9bd69ac0212653911565c8491d42616b1467bcd /python
parent3985402d74c7743724daecfc68dc10388cb870d9 (diff)
downloadbuild_soong-d44aa3b5c8afbfeb66e39668bab3ec0fac63f1e6.tar.gz
build_soong-d44aa3b5c8afbfeb66e39668bab3ec0fac63f1e6.tar.bz2
build_soong-d44aa3b5c8afbfeb66e39668bab3ec0fac63f1e6.zip
Extract failIfErrored() to android/testing.go
Bug: 74506774 Test: lunch aosp_walleye-userdebug && make # runs unit tests Merged-In: I1c09412d5988dca2cc1c5f041893b313ab1c163a Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
Diffstat (limited to 'python')
-rw-r--r--python/python_test.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/python/python_test.go b/python/python_test.go
index 176c6eca..ad80167e 100644
--- a/python/python_test.go
+++ b/python/python_test.go
@@ -347,7 +347,7 @@ func TestPythonModule(t *testing.T) {
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 @@ func TestPythonModule(t *testing.T) {
e.parSpec, e.depsParSpecs)...)
}
}
- fail(t, testErrs)
+ android.FailIfErrored(t, testErrs)
})
}
}
@@ -458,12 +458,3 @@ func setupBuildEnv(t *testing.T) (config android.Config, buildDir string) {
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()
- }
-}