diff options
author | yangbill <yangbill@google.com> | 2019-02-13 21:45:47 +0800 |
---|---|---|
committer | yangbill <yangbill@google.com> | 2019-02-19 22:25:50 +0800 |
commit | 4f41bc2bed906b3baf973ffcdcf3f7f0cb987a1d (patch) | |
tree | 2160508628e0619a77e47fde336d2e591038d250 /tradefed | |
parent | 1f9e90a3043197059f73051f4496c91a41760cec (diff) | |
download | build_soong-4f41bc2bed906b3baf973ffcdcf3f7f0cb987a1d.tar.gz build_soong-4f41bc2bed906b3baf973ffcdcf3f7f0cb987a1d.tar.bz2 build_soong-4f41bc2bed906b3baf973ffcdcf3f7f0cb987a1d.zip |
[SOONG] Not auto-generate test config if test_suite is cts
Current soong use source code's under cts as the rule for judgement.
Should change to use test_suites define instead.
Bug: 124313692
Test: m hello_world_test, make sure test config be auog-enerated.
Modified platform_testing/tests/example/native/Android.bp
m hello_world_test, make sure test config not be auto-generatetd.
Change-Id: I1bc5216f73329d2a82d9ff29ccbede436dd2976c
Diffstat (limited to 'tradefed')
-rw-r--r-- | tradefed/autogen.go | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/tradefed/autogen.go b/tradefed/autogen.go index e6a1b48c..cfa7164b 100644 --- a/tradefed/autogen.go +++ b/tradefed/autogen.go @@ -15,8 +15,6 @@ package tradefed import ( - "strings" - "github.com/google/blueprint" "android/soong/android" @@ -40,10 +38,10 @@ var autogenTestConfig = pctx.StaticRule("autogenTestConfig", blueprint.RuleParam CommandDeps: []string{"$template"}, }, "name", "template") -func testConfigPath(ctx android.ModuleContext, prop *string) (path android.Path, autogenPath android.WritablePath) { +func testConfigPath(ctx android.ModuleContext, prop *string, testSuites []string) (path android.Path, autogenPath android.WritablePath) { if p := getTestConfig(ctx, prop); p != nil { return p, nil - } else if !strings.HasPrefix(ctx.ModuleDir(), "cts/") { + } else if !android.InList("cts", testSuites) { outputFile := android.PathForModuleOut(ctx, ctx.ModuleName()+".config") return nil, outputFile } else { @@ -67,8 +65,8 @@ func autogenTemplate(ctx android.ModuleContext, output android.WritablePath, tem } func AutoGenNativeTestConfig(ctx android.ModuleContext, testConfigProp *string, - testConfigTemplateProp *string) android.Path { - path, autogenPath := testConfigPath(ctx, testConfigProp) + testConfigTemplateProp *string, testSuites []string) android.Path { + path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites) if autogenPath != nil { templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp) if templatePath.Valid() { @@ -86,8 +84,8 @@ func AutoGenNativeTestConfig(ctx android.ModuleContext, testConfigProp *string, } func AutoGenNativeBenchmarkTestConfig(ctx android.ModuleContext, testConfigProp *string, - testConfigTemplateProp *string) android.Path { - path, autogenPath := testConfigPath(ctx, testConfigProp) + testConfigTemplateProp *string, testSuites []string) android.Path { + path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites) if autogenPath != nil { templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp) if templatePath.Valid() { @@ -100,8 +98,8 @@ func AutoGenNativeBenchmarkTestConfig(ctx android.ModuleContext, testConfigProp return path } -func AutoGenJavaTestConfig(ctx android.ModuleContext, testConfigProp *string, testConfigTemplateProp *string) android.Path { - path, autogenPath := testConfigPath(ctx, testConfigProp) +func AutoGenJavaTestConfig(ctx android.ModuleContext, testConfigProp *string, testConfigTemplateProp *string, testSuites []string) android.Path { + path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites) if autogenPath != nil { templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp) if templatePath.Valid() { @@ -119,9 +117,9 @@ func AutoGenJavaTestConfig(ctx android.ModuleContext, testConfigProp *string, te } func AutoGenPythonBinaryHostTestConfig(ctx android.ModuleContext, testConfigProp *string, - testConfigTemplateProp *string) android.Path { + testConfigTemplateProp *string, testSuites []string) android.Path { - path, autogenPath := testConfigPath(ctx, testConfigProp) + path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites) if autogenPath != nil { templatePath := getTestConfigTemplate(ctx, testConfigTemplateProp) if templatePath.Valid() { @@ -143,8 +141,8 @@ var autogenInstrumentationTest = pctx.StaticRule("autogenInstrumentationTest", b }, }, "name", "template") -func AutoGenInstrumentationTestConfig(ctx android.ModuleContext, testConfigProp *string, testConfigTemplateProp *string, manifest android.Path) android.Path { - path, autogenPath := testConfigPath(ctx, testConfigProp) +func AutoGenInstrumentationTestConfig(ctx android.ModuleContext, testConfigProp *string, testConfigTemplateProp *string, manifest android.Path, testSuites []string) android.Path { + path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites) if autogenPath != nil { template := "${InstrumentationTestConfigTemplate}" moduleTemplate := getTestConfigTemplate(ctx, testConfigTemplateProp) |