Merge "Export a few utility methods"
This commit is contained in:
16
java/java.go
16
java/java.go
@@ -2520,6 +2520,10 @@ func (j *TestHost) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
j.deps(ctx)
|
||||
}
|
||||
|
||||
func (j *TestHost) AddExtraResource(p android.Path) {
|
||||
j.extraResources = append(j.extraResources, p)
|
||||
}
|
||||
|
||||
func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
if j.testProperties.Test_options.Unit_test == nil && ctx.Host() {
|
||||
// TODO(b/): Clean temporary heuristic to avoid unexpected onboarding.
|
||||
@@ -2683,13 +2687,23 @@ func TestHostFactory() android.Module {
|
||||
module.AddProperties(&module.testProperties)
|
||||
module.AddProperties(&module.testHostProperties)
|
||||
|
||||
module.Module.properties.Installable = proptools.BoolPtr(true)
|
||||
InitTestHost(
|
||||
module,
|
||||
proptools.BoolPtr(true),
|
||||
nil,
|
||||
nil)
|
||||
|
||||
InitJavaModuleMultiTargets(module, android.HostSupported)
|
||||
|
||||
return module
|
||||
}
|
||||
|
||||
func InitTestHost(th *TestHost, installable *bool, testSuites []string, autoGenConfig *bool) {
|
||||
th.properties.Installable = installable
|
||||
th.testProperties.Auto_gen_config = autoGenConfig
|
||||
th.testProperties.Test_suites = testSuites
|
||||
}
|
||||
|
||||
//
|
||||
// Java Binaries (.jar file plus wrapper script)
|
||||
//
|
||||
|
@@ -2601,3 +2601,16 @@ func TestDataNativeBinaries(t *testing.T) {
|
||||
t.Errorf("Unexpected test data - expected: %q, actual: %q", expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultInstallable(t *testing.T) {
|
||||
ctx, _ := testJava(t, `
|
||||
java_test_host {
|
||||
name: "foo"
|
||||
}
|
||||
`)
|
||||
|
||||
buildOS := android.BuildOs.String()
|
||||
module := ctx.ModuleForTests("foo", buildOS+"_common").Module().(*TestHost)
|
||||
assertDeepEquals(t, "Default installable value should be true.", proptools.BoolPtr(true),
|
||||
module.properties.Installable)
|
||||
}
|
||||
|
Reference in New Issue
Block a user