Loading android/module.go +7 −0 Original line number Diff line number Diff line Loading @@ -942,12 +942,19 @@ type CommonTestOptions struct { // If the test is a hostside (no device required) unittest that shall be run // during presubmit check. Unit_test *bool // Tags provide additional metadata to customize test execution by downstream // test runners. The tags have no special meaning to Soong. Tags []string } // SetAndroidMkEntries sets AndroidMkEntries according to the value of base // `test_options`. func (t *CommonTestOptions) SetAndroidMkEntries(entries *AndroidMkEntries) { entries.SetBoolIfTrue("LOCAL_IS_UNIT_TEST", Bool(t.Unit_test)) if len(t.Tags) > 0 { entries.AddStrings("LOCAL_TEST_OPTIONS_TAGS", t.Tags...) } } // The key to use in TaggedDistFiles when a Dist structure does not specify a Loading android/module_test.go +26 −1 Original line number Diff line number Diff line Loading @@ -912,7 +912,7 @@ func TestSortedUniqueNamedPaths(t *testing.T) { } } func TestProcessCommonTestOptions(t *testing.T) { func TestSetAndroidMkEntriesWithTestOptions(t *testing.T) { tests := []struct { name string testOptions CommonTestOptions Loading @@ -939,6 +939,31 @@ func TestProcessCommonTestOptions(t *testing.T) { }, expected: map[string][]string{}, }, { name: "empty tag", testOptions: CommonTestOptions{ Tags: []string{}, }, expected: map[string][]string{}, }, { name: "single tag", testOptions: CommonTestOptions{ Tags: []string{"tag1"}, }, expected: map[string][]string{ "LOCAL_TEST_OPTIONS_TAGS": []string{"tag1"}, }, }, { name: "multiple tag", testOptions: CommonTestOptions{ Tags: []string{"tag1", "tag2", "tag3"}, }, expected: map[string][]string{ "LOCAL_TEST_OPTIONS_TAGS": []string{"tag1", "tag2", "tag3"}, }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { Loading Loading
android/module.go +7 −0 Original line number Diff line number Diff line Loading @@ -942,12 +942,19 @@ type CommonTestOptions struct { // If the test is a hostside (no device required) unittest that shall be run // during presubmit check. Unit_test *bool // Tags provide additional metadata to customize test execution by downstream // test runners. The tags have no special meaning to Soong. Tags []string } // SetAndroidMkEntries sets AndroidMkEntries according to the value of base // `test_options`. func (t *CommonTestOptions) SetAndroidMkEntries(entries *AndroidMkEntries) { entries.SetBoolIfTrue("LOCAL_IS_UNIT_TEST", Bool(t.Unit_test)) if len(t.Tags) > 0 { entries.AddStrings("LOCAL_TEST_OPTIONS_TAGS", t.Tags...) } } // The key to use in TaggedDistFiles when a Dist structure does not specify a Loading
android/module_test.go +26 −1 Original line number Diff line number Diff line Loading @@ -912,7 +912,7 @@ func TestSortedUniqueNamedPaths(t *testing.T) { } } func TestProcessCommonTestOptions(t *testing.T) { func TestSetAndroidMkEntriesWithTestOptions(t *testing.T) { tests := []struct { name string testOptions CommonTestOptions Loading @@ -939,6 +939,31 @@ func TestProcessCommonTestOptions(t *testing.T) { }, expected: map[string][]string{}, }, { name: "empty tag", testOptions: CommonTestOptions{ Tags: []string{}, }, expected: map[string][]string{}, }, { name: "single tag", testOptions: CommonTestOptions{ Tags: []string{"tag1"}, }, expected: map[string][]string{ "LOCAL_TEST_OPTIONS_TAGS": []string{"tag1"}, }, }, { name: "multiple tag", testOptions: CommonTestOptions{ Tags: []string{"tag1", "tag2", "tag3"}, }, expected: map[string][]string{ "LOCAL_TEST_OPTIONS_TAGS": []string{"tag1", "tag2", "tag3"}, }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { Loading