summaryrefslogtreecommitdiff
path: root/java/sdk_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/sdk_test.go')
-rw-r--r--java/sdk_test.go33
1 files changed, 15 insertions, 18 deletions
diff --git a/java/sdk_test.go b/java/sdk_test.go
index 37875a43b..ff0a2039b 100644
--- a/java/sdk_test.go
+++ b/java/sdk_test.go
@@ -16,7 +16,6 @@ package java
import (
"path/filepath"
- "reflect"
"strings"
"testing"
@@ -98,7 +97,7 @@ func TestClasspath(t *testing.T) {
bootclasspath: []string{"android_stubs_current", "core-lambda-stubs"},
system: "core-current-stubs-system-modules",
java9classpath: []string{"android_stubs_current"},
- aidl: "-p" + buildDir + "/framework.aidl",
+ aidl: "-pout/soong/framework.aidl",
},
{
@@ -107,7 +106,7 @@ func TestClasspath(t *testing.T) {
bootclasspath: []string{"android_system_stubs_current", "core-lambda-stubs"},
system: "core-current-stubs-system-modules",
java9classpath: []string{"android_system_stubs_current"},
- aidl: "-p" + buildDir + "/framework.aidl",
+ aidl: "-pout/soong/framework.aidl",
},
{
@@ -135,7 +134,7 @@ func TestClasspath(t *testing.T) {
bootclasspath: []string{"android_test_stubs_current", "core-lambda-stubs"},
system: "core-current-stubs-system-modules",
java9classpath: []string{"android_test_stubs_current"},
- aidl: "-p" + buildDir + "/framework.aidl",
+ aidl: "-pout/soong/framework.aidl",
},
{
@@ -222,7 +221,7 @@ func TestClasspath(t *testing.T) {
bootclasspath: []string{"android_module_lib_stubs_current", "core-lambda-stubs"},
system: "core-current-stubs-system-modules",
java9classpath: []string{"android_module_lib_stubs_current"},
- aidl: "-p" + buildDir + "/framework_non_updatable.aidl",
+ aidl: "-pout/soong/framework_non_updatable.aidl",
},
{
name: "system_server_current",
@@ -230,7 +229,7 @@ func TestClasspath(t *testing.T) {
bootclasspath: []string{"android_system_server_stubs_current", "core-lambda-stubs"},
system: "core-current-stubs-system-modules",
java9classpath: []string{"android_system_server_stubs_current"},
- aidl: "-p" + buildDir + "/framework.aidl",
+ aidl: "-pout/soong/framework.aidl",
},
}
@@ -303,23 +302,23 @@ func TestClasspath(t *testing.T) {
} else {
dir = defaultJavaDir
}
- system = "--system=" + filepath.Join(buildDir, ".intermediates", dir, testcase.system, "android_common", "system")
+ system = "--system=" + filepath.Join("out", "soong", ".intermediates", dir, testcase.system, "android_common", "system")
// The module-relative parts of these paths are hardcoded in system_modules.go:
systemDeps = []string{
- filepath.Join(buildDir, ".intermediates", dir, testcase.system, "android_common", "system", "lib", "modules"),
- filepath.Join(buildDir, ".intermediates", dir, testcase.system, "android_common", "system", "lib", "jrt-fs.jar"),
- filepath.Join(buildDir, ".intermediates", dir, testcase.system, "android_common", "system", "release"),
+ filepath.Join("out", "soong", ".intermediates", dir, testcase.system, "android_common", "system", "lib", "modules"),
+ filepath.Join("out", "soong", ".intermediates", dir, testcase.system, "android_common", "system", "lib", "jrt-fs.jar"),
+ filepath.Join("out", "soong", ".intermediates", dir, testcase.system, "android_common", "system", "release"),
}
}
checkClasspath := func(t *testing.T, result *android.TestResult, isJava8 bool) {
foo := result.ModuleForTests("foo", variant)
- javac := foo.Rule("javac")
+ javac := foo.Rule("javac").RelativeToTop()
var deps []string
- aidl := foo.MaybeRule("aidl")
+ aidl := foo.MaybeRule("aidl").RelativeToTop()
if aidl.Rule != nil {
- deps = append(deps, aidl.Output.String())
+ deps = append(deps, android.PathRelativeToTop(aidl.Output))
}
got := javac.Args["bootClasspath"]
@@ -347,9 +346,7 @@ func TestClasspath(t *testing.T) {
t.Errorf("classpath expected %q != got %q", expected, got)
}
- if !reflect.DeepEqual(javac.Implicits.Strings(), deps) {
- t.Errorf("implicits expected %q != got %q", deps, javac.Implicits.Strings())
- }
+ android.AssertPathsRelativeToTopEquals(t, "implicits", deps, javac.Implicits)
}
fixtureFactory := javaFixtureFactory.Extend(
@@ -378,7 +375,7 @@ func TestClasspath(t *testing.T) {
checkClasspath(t, result, true /* isJava8 */)
if testcase.host != android.Host {
- aidl := result.ModuleForTests("foo", variant).Rule("aidl")
+ aidl := result.ModuleForTests("foo", variant).Rule("aidl").RelativeToTop()
android.AssertStringDoesContain(t, "aidl command", aidl.RuleParams.Command, testcase.aidl+" -I.")
}
@@ -391,7 +388,7 @@ func TestClasspath(t *testing.T) {
checkClasspath(t, result, false /* isJava8 */)
if testcase.host != android.Host {
- aidl := result.ModuleForTests("foo", variant).Rule("aidl")
+ aidl := result.ModuleForTests("foo", variant).Rule("aidl").RelativeToTop()
android.AssertStringDoesContain(t, "aidl command", aidl.RuleParams.Command, testcase.aidl+" -I.")
}