summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorJeongik Cha <jeongik@google.com>2019-07-11 15:54:27 +0900
committerJeongik Cha <jeongik@google.com>2019-07-29 20:48:30 +0900
commit538c0d0c29fdb4508d00a30bdc4fa222b31d598f (patch)
tree9fedadbb74d873298f25fe774f6186629940a020 /java/java_test.go
parentc89fe6253f67810e4340c595e63fb25c0ff7d09b (diff)
Add a rule about platform_apis
As sdk_check.mk checks, soong starts to check every app. If sdk_version is empty, platform_apis must be true. If sdk_version is not empty, platform_apis must be false. Test: soong test Test: m Bug: 132780927 Change-Id: I7ba702d616404d155f8ac40cd008828663ad1488
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)