diff options
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/java/java_test.go b/java/java_test.go index 8407f2462..bb51ebc3d 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -114,20 +114,26 @@ func testJavaErrorWithConfig(t *testing.T, pattern string, config android.Config pathCtx := android.PathContextForTesting(config) dexpreopt.SetTestGlobalConfig(config, dexpreopt.GlobalConfigForTests(pathCtx)) + runWithErrors(t, ctx, config, pattern) + + return ctx, config +} + +func runWithErrors(t *testing.T, ctx *android.TestContext, config android.Config, pattern string) { ctx.Register() _, errs := ctx.ParseBlueprintsFiles("Android.bp") if len(errs) > 0 { android.FailIfNoMatchingErrors(t, pattern, errs) - return ctx, config + return } _, errs = ctx.PrepareBuildActions(config) if len(errs) > 0 { android.FailIfNoMatchingErrors(t, pattern, errs) - return ctx, config + return } t.Fatalf("missing expected error %q (0 errors are returned)", pattern) - return ctx, config + return } func testJavaWithFS(t *testing.T, bp string, fs map[string][]byte) (*android.TestContext, android.Config) { |