summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorJeongik Cha <jeongik@google.com>2019-07-31 01:09:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-07-31 01:09:35 +0000
commit8a64f8c907b764bb581e34c344f77d622cb1d6e6 (patch)
tree58ec7142815d897f90cadc36f0da9b4f585376ce /java/java_test.go
parent1eee154c3b6e67c4b3c4c9fe4853dd432e7b590e (diff)
parent538c0d0c29fdb4508d00a30bdc4fa222b31d598f (diff)
Merge "Add a rule about platform_apis"
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 f95f88bb4..81d1f2cb7 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)