summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorJeongik Cha <jeongik@google.com>2019-07-30 18:33:08 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-07-30 18:33:08 -0700
commita741ebf342983bf4ea9601bdd959cfbdc8472728 (patch)
tree99b35af5ef07a413697e38b2113dff2e2cf1e677 /java/java_test.go
parentded55a4ee809e00077da3345316d72b2c5fbea8b (diff)
parent8a64f8c907b764bb581e34c344f77d622cb1d6e6 (diff)
Merge "Add a rule about platform_apis"
am: 8a64f8c907 Change-Id: Ifdd8bd693fee625f63db403ce7a4dbc9209eb398
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index d3d5c2459..17f3a218a 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -222,6 +222,29 @@ func run(t *testing.T, ctx *android.TestContext, config android.Config) {
android.FailIfErrored(t, errs)
}
+func testJavaError(t *testing.T, pattern string, bp string) {
+ t.Helper()
+ config := testConfig(nil)
+ ctx := testContext(bp, nil)
+
+ pathCtx := android.PathContextForTesting(config, nil)
+ setDexpreoptTestGlobalConfig(config, dexpreopt.GlobalConfigForTests(pathCtx))
+
+ ctx.Register()
+ _, errs := ctx.ParseBlueprintsFiles("Android.bp")
+ if len(errs) > 0 {
+ android.FailIfNoMatchingErrors(t, pattern, errs)
+ return
+ }
+ _, errs = ctx.PrepareBuildActions(config)
+ if len(errs) > 0 {
+ android.FailIfNoMatchingErrors(t, pattern, errs)
+ return
+ }
+
+ t.Fatalf("missing expected error %q (0 errors are returned)", pattern)
+}
+
func testJava(t *testing.T, bp string) (*android.TestContext, android.Config) {
t.Helper()
config := testConfig(nil)