Switch noticeindex from regex to proto.
Bug: 254534552 Test: m droid dist cts alllicensemetadata Test: repo forall -c 'echo -n "$REPO_PATH " && $ANDROID_BUILD_TOP/out/host/linux-x86/bin/compliance_checkmetadata . 2>&1' | fgrep -v PASS Change-Id: I34dfe143cdc88432d6e33abee096409a37ce3b7e
This commit is contained in:
@@ -65,7 +65,16 @@ func Test(t *testing.T) {
|
||||
target{"highest.apex/lib/libb.so", "Android"},
|
||||
firstParty{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/firstparty/FIRST_PARTY_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/firstparty/bin/bin1.meta_lic",
|
||||
"testdata/firstparty/bin/bin2.meta_lic",
|
||||
"testdata/firstparty/highest.apex.meta_lic",
|
||||
"testdata/firstparty/lib/liba.so.meta_lic",
|
||||
"testdata/firstparty/lib/libb.so.meta_lic",
|
||||
"testdata/firstparty/lib/libc.a.meta_lic",
|
||||
"testdata/firstparty/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: "firstparty",
|
||||
@@ -79,7 +88,16 @@ func Test(t *testing.T) {
|
||||
target{"container.zip/libb.so", "Android"},
|
||||
firstParty{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/firstparty/FIRST_PARTY_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/firstparty/bin/bin1.meta_lic",
|
||||
"testdata/firstparty/bin/bin2.meta_lic",
|
||||
"testdata/firstparty/container.zip.meta_lic",
|
||||
"testdata/firstparty/lib/liba.so.meta_lic",
|
||||
"testdata/firstparty/lib/libb.so.meta_lic",
|
||||
"testdata/firstparty/lib/libc.a.meta_lic",
|
||||
"testdata/firstparty/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: "firstparty",
|
||||
@@ -89,7 +107,13 @@ func Test(t *testing.T) {
|
||||
target{"application", "Android"},
|
||||
firstParty{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/firstparty/FIRST_PARTY_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/firstparty/application.meta_lic",
|
||||
"testdata/firstparty/bin/bin3.meta_lic",
|
||||
"testdata/firstparty/lib/liba.so.meta_lic",
|
||||
"testdata/firstparty/lib/libb.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: "firstparty",
|
||||
@@ -99,7 +123,12 @@ func Test(t *testing.T) {
|
||||
target{"bin/bin1", "Android"},
|
||||
firstParty{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/firstparty/FIRST_PARTY_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/firstparty/bin/bin1.meta_lic",
|
||||
"testdata/firstparty/lib/liba.so.meta_lic",
|
||||
"testdata/firstparty/lib/libc.a.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: "firstparty",
|
||||
@@ -109,7 +138,10 @@ func Test(t *testing.T) {
|
||||
target{"lib/libd.so", "Android"},
|
||||
firstParty{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/firstparty/FIRST_PARTY_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/firstparty/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: "notice",
|
||||
@@ -129,6 +161,13 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/notice/NOTICE_LICENSE",
|
||||
"testdata/notice/bin/bin1.meta_lic",
|
||||
"testdata/notice/bin/bin2.meta_lic",
|
||||
"testdata/notice/highest.apex.meta_lic",
|
||||
"testdata/notice/lib/liba.so.meta_lic",
|
||||
"testdata/notice/lib/libb.so.meta_lic",
|
||||
"testdata/notice/lib/libc.a.meta_lic",
|
||||
"testdata/notice/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -149,6 +188,13 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/notice/NOTICE_LICENSE",
|
||||
"testdata/notice/bin/bin1.meta_lic",
|
||||
"testdata/notice/bin/bin2.meta_lic",
|
||||
"testdata/notice/container.zip.meta_lic",
|
||||
"testdata/notice/lib/liba.so.meta_lic",
|
||||
"testdata/notice/lib/libb.so.meta_lic",
|
||||
"testdata/notice/lib/libc.a.meta_lic",
|
||||
"testdata/notice/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -164,6 +210,10 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/notice/NOTICE_LICENSE",
|
||||
"testdata/notice/application.meta_lic",
|
||||
"testdata/notice/bin/bin3.meta_lic",
|
||||
"testdata/notice/lib/liba.so.meta_lic",
|
||||
"testdata/notice/lib/libb.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -180,6 +230,9 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/notice/NOTICE_LICENSE",
|
||||
"testdata/notice/bin/bin1.meta_lic",
|
||||
"testdata/notice/lib/liba.so.meta_lic",
|
||||
"testdata/notice/lib/libc.a.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -190,7 +243,10 @@ func Test(t *testing.T) {
|
||||
target{"lib/libd.so", "External"},
|
||||
notice{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/notice/NOTICE_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/notice/NOTICE_LICENSE",
|
||||
"testdata/notice/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: "reciprocal",
|
||||
@@ -210,6 +266,13 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/reciprocal/RECIPROCAL_LICENSE",
|
||||
"testdata/reciprocal/bin/bin1.meta_lic",
|
||||
"testdata/reciprocal/bin/bin2.meta_lic",
|
||||
"testdata/reciprocal/highest.apex.meta_lic",
|
||||
"testdata/reciprocal/lib/liba.so.meta_lic",
|
||||
"testdata/reciprocal/lib/libb.so.meta_lic",
|
||||
"testdata/reciprocal/lib/libc.a.meta_lic",
|
||||
"testdata/reciprocal/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -230,6 +293,13 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/reciprocal/RECIPROCAL_LICENSE",
|
||||
"testdata/reciprocal/bin/bin1.meta_lic",
|
||||
"testdata/reciprocal/bin/bin2.meta_lic",
|
||||
"testdata/reciprocal/container.zip.meta_lic",
|
||||
"testdata/reciprocal/lib/liba.so.meta_lic",
|
||||
"testdata/reciprocal/lib/libb.so.meta_lic",
|
||||
"testdata/reciprocal/lib/libc.a.meta_lic",
|
||||
"testdata/reciprocal/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -245,6 +315,10 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/reciprocal/RECIPROCAL_LICENSE",
|
||||
"testdata/reciprocal/application.meta_lic",
|
||||
"testdata/reciprocal/bin/bin3.meta_lic",
|
||||
"testdata/reciprocal/lib/liba.so.meta_lic",
|
||||
"testdata/reciprocal/lib/libb.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -261,6 +335,9 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/reciprocal/RECIPROCAL_LICENSE",
|
||||
"testdata/reciprocal/bin/bin1.meta_lic",
|
||||
"testdata/reciprocal/lib/liba.so.meta_lic",
|
||||
"testdata/reciprocal/lib/libc.a.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -271,7 +348,10 @@ func Test(t *testing.T) {
|
||||
target{"lib/libd.so", "External"},
|
||||
notice{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/notice/NOTICE_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/notice/NOTICE_LICENSE",
|
||||
"testdata/reciprocal/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: "restricted",
|
||||
@@ -294,6 +374,13 @@ func Test(t *testing.T) {
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/reciprocal/RECIPROCAL_LICENSE",
|
||||
"testdata/restricted/RESTRICTED_LICENSE",
|
||||
"testdata/restricted/bin/bin1.meta_lic",
|
||||
"testdata/restricted/bin/bin2.meta_lic",
|
||||
"testdata/restricted/highest.apex.meta_lic",
|
||||
"testdata/restricted/lib/liba.so.meta_lic",
|
||||
"testdata/restricted/lib/libb.so.meta_lic",
|
||||
"testdata/restricted/lib/libc.a.meta_lic",
|
||||
"testdata/restricted/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -317,6 +404,13 @@ func Test(t *testing.T) {
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/reciprocal/RECIPROCAL_LICENSE",
|
||||
"testdata/restricted/RESTRICTED_LICENSE",
|
||||
"testdata/restricted/bin/bin1.meta_lic",
|
||||
"testdata/restricted/bin/bin2.meta_lic",
|
||||
"testdata/restricted/container.zip.meta_lic",
|
||||
"testdata/restricted/lib/liba.so.meta_lic",
|
||||
"testdata/restricted/lib/libb.so.meta_lic",
|
||||
"testdata/restricted/lib/libc.a.meta_lic",
|
||||
"testdata/restricted/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -332,6 +426,10 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/restricted/RESTRICTED_LICENSE",
|
||||
"testdata/restricted/application.meta_lic",
|
||||
"testdata/restricted/bin/bin3.meta_lic",
|
||||
"testdata/restricted/lib/liba.so.meta_lic",
|
||||
"testdata/restricted/lib/libb.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -350,6 +448,9 @@ func Test(t *testing.T) {
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/reciprocal/RECIPROCAL_LICENSE",
|
||||
"testdata/restricted/RESTRICTED_LICENSE",
|
||||
"testdata/restricted/bin/bin1.meta_lic",
|
||||
"testdata/restricted/lib/liba.so.meta_lic",
|
||||
"testdata/restricted/lib/libc.a.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -360,7 +461,10 @@ func Test(t *testing.T) {
|
||||
target{"lib/libd.so", "External"},
|
||||
notice{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/notice/NOTICE_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/notice/NOTICE_LICENSE",
|
||||
"testdata/restricted/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: "proprietary",
|
||||
@@ -382,6 +486,13 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/proprietary/PROPRIETARY_LICENSE",
|
||||
"testdata/proprietary/bin/bin1.meta_lic",
|
||||
"testdata/proprietary/bin/bin2.meta_lic",
|
||||
"testdata/proprietary/highest.apex.meta_lic",
|
||||
"testdata/proprietary/lib/liba.so.meta_lic",
|
||||
"testdata/proprietary/lib/libb.so.meta_lic",
|
||||
"testdata/proprietary/lib/libc.a.meta_lic",
|
||||
"testdata/proprietary/lib/libd.so.meta_lic",
|
||||
"testdata/restricted/RESTRICTED_LICENSE",
|
||||
},
|
||||
},
|
||||
@@ -405,6 +516,13 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/proprietary/PROPRIETARY_LICENSE",
|
||||
"testdata/proprietary/bin/bin1.meta_lic",
|
||||
"testdata/proprietary/bin/bin2.meta_lic",
|
||||
"testdata/proprietary/container.zip.meta_lic",
|
||||
"testdata/proprietary/lib/liba.so.meta_lic",
|
||||
"testdata/proprietary/lib/libb.so.meta_lic",
|
||||
"testdata/proprietary/lib/libc.a.meta_lic",
|
||||
"testdata/proprietary/lib/libd.so.meta_lic",
|
||||
"testdata/restricted/RESTRICTED_LICENSE",
|
||||
},
|
||||
},
|
||||
@@ -421,6 +539,10 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/proprietary/PROPRIETARY_LICENSE",
|
||||
"testdata/proprietary/application.meta_lic",
|
||||
"testdata/proprietary/bin/bin3.meta_lic",
|
||||
"testdata/proprietary/lib/liba.so.meta_lic",
|
||||
"testdata/proprietary/lib/libb.so.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -437,6 +559,9 @@ func Test(t *testing.T) {
|
||||
expectedDeps: []string{
|
||||
"testdata/firstparty/FIRST_PARTY_LICENSE",
|
||||
"testdata/proprietary/PROPRIETARY_LICENSE",
|
||||
"testdata/proprietary/bin/bin1.meta_lic",
|
||||
"testdata/proprietary/lib/liba.so.meta_lic",
|
||||
"testdata/proprietary/lib/libc.a.meta_lic",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -447,7 +572,10 @@ func Test(t *testing.T) {
|
||||
target{"lib/libd.so", "External"},
|
||||
notice{},
|
||||
},
|
||||
expectedDeps: []string{"testdata/notice/NOTICE_LICENSE"},
|
||||
expectedDeps: []string{
|
||||
"testdata/notice/NOTICE_LICENSE",
|
||||
"testdata/proprietary/lib/libd.so.meta_lic",
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
Reference in New Issue
Block a user