summaryrefslogtreecommitdiff
path: root/java/sdk_test.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-01-09 23:04:25 -0800
committerColin Cross <ccross@android.com>2019-01-10 07:09:35 +0000
commit98fd57460f718dbc06faeb6a029574e6f2a028b6 (patch)
tree8b2a20eb3b33738c1235e808cd6359effd3b2be3 /java/sdk_test.go
parentfb6d78120233e5aff492fa827c27ba87354fc9e8 (diff)
Use latest SDK version for current in PDK builds
PDK builds need to use the latest SDK version instead of "current" to match the behavior of Make. Bug: 118634643 Test: sdk_test.go Change-Id: Ice10d0ccb4066f27ce5839fc96a4026510057121
Diffstat (limited to 'java/sdk_test.go')
-rw-r--r--java/sdk_test.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/java/sdk_test.go b/java/sdk_test.go
index ced772908..6924e2654 100644
--- a/java/sdk_test.go
+++ b/java/sdk_test.go
@@ -27,6 +27,7 @@ import (
var classpathTestcases = []struct {
name string
unbundled bool
+ pdk bool
moduleType string
host android.OsClass
properties string
@@ -155,6 +156,30 @@ var classpathTestcases = []struct {
system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
classpath: []string{"prebuilts/sdk/current/public/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"},
},
+
+ {
+ name: "pdk default",
+ pdk: true,
+ bootclasspath: []string{`""`},
+ system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
+ classpath: []string{"prebuilts/sdk/17/public/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"},
+ },
+ {
+ name: "pdk current",
+ pdk: true,
+ properties: `sdk_version: "current",`,
+ bootclasspath: []string{`""`},
+ system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
+ classpath: []string{"prebuilts/sdk/17/public/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"},
+ },
+ {
+ name: "pdk 14",
+ pdk: true,
+ properties: `sdk_version: "14",`,
+ bootclasspath: []string{`""`},
+ system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
+ classpath: []string{"prebuilts/sdk/14/public/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"},
+ },
}
func TestClasspath(t *testing.T) {
@@ -209,6 +234,9 @@ func TestClasspath(t *testing.T) {
if testcase.unbundled {
config.TestProductVariables.Unbundled_build = proptools.BoolPtr(true)
}
+ if testcase.pdk {
+ config.TestProductVariables.Pdk = proptools.BoolPtr(true)
+ }
ctx := testContext(config, bp, nil)
run(t, ctx, config)
@@ -241,6 +269,9 @@ func TestClasspath(t *testing.T) {
if testcase.unbundled {
config.TestProductVariables.Unbundled_build = proptools.BoolPtr(true)
}
+ if testcase.pdk {
+ config.TestProductVariables.Pdk = proptools.BoolPtr(true)
+ }
ctx := testContext(config, bp, nil)
run(t, ctx, config)