summaryrefslogtreecommitdiff
path: root/android/module_test.go
diff options
context:
space:
mode:
author Zhenhuang Wang <zeek@google.com> 2022-08-22 16:00:05 +0800
committer Zhenhuang Wang <zeek@google.com> 2022-08-22 08:16:17 +0000
commit409d27712f927c84b58091d2be54c7638cd619cd (patch)
treee0ccc5b5a776d92168e17f293d2e1f51072fb81f /android/module_test.go
parentf5b0c2a1786439757f04a5fb8e1c8d913e9f738d (diff)
Add a new `test_options.tags` attribute to customize test execution
The `test_options.tags` attribute provides additional metadata to customize test execution by downstream test runners. The tags have no special meaning to Soong. Bug: 240928948 Test: manually add `test_options.tags` attribute and run: $ refreshmod && \ cat out/target/product/generic/module-info.json |\ grep <tags> Change-Id: I35267f6608e48c6184e56530ef128d93b2f97522
Diffstat (limited to 'android/module_test.go')
-rw-r--r--android/module_test.go27
1 files changed, 26 insertions, 1 deletions
diff --git a/android/module_test.go b/android/module_test.go
index 835ab4c7c..0580bef24 100644
--- a/android/module_test.go
+++ b/android/module_test.go
@@ -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
@@ -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) {