summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorLogan Chien <loganchien@google.com>2018-03-12 16:29:17 +0800
committerLogan Chien <loganchien@google.com>2018-03-15 11:02:38 +0800
commit4203971351ac8701c00c05252839221d13fbf3d0 (patch)
tree1ac57bf84e9a7ca349a79e9b072c6a46076a7b55 /java/java_test.go
parent9c6bc37da1dd47ff61e324f2b477e9e3d7a98a99 (diff)
Extract failIfErrored() to android/testing.go
Bug: 74506774 Test: lunch aosp_walleye-userdebug && make # runs unit tests Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 5d6a6e0e8..6ef406f76 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -190,9 +190,9 @@ func testContext(config android.Config, bp string,
func run(t *testing.T, ctx *android.TestContext, config android.Config) {
t.Helper()
_, errs := ctx.ParseFileList(".", []string{"Android.bp"})
- fail(t, errs)
+ android.FailIfErrored(t, errs)
_, errs = ctx.PrepareBuildActions(config)
- fail(t, errs)
+ android.FailIfErrored(t, errs)
}
func testJava(t *testing.T, bp string) *android.TestContext {
@@ -977,13 +977,3 @@ func TestExcludeFileGroupInSrcs(t *testing.T) {
t.Errorf(`foo inputs %v != ["java-fg/c.java"]`, javac.Inputs)
}
}
-
-func fail(t *testing.T, errs []error) {
- t.Helper()
- if len(errs) > 0 {
- for _, err := range errs {
- t.Error(err)
- }
- t.FailNow()
- }
-}