Support OUT_DIR for license graph.

Bug: 226066987

Test: OUT_DIR=/tmp/outdir m all listshare checkshare htmlnotice rtrace dumpgraph dumpresolutions compliancenotice_bom compliancenotice_shippedlibs
Test: OUT_DIR=/tmp/outdir m /tmp/outdir/target/product/bonito/obj/NOTICE.xml.gz
Test: m all listshare checkshare htmlnotice rtrace dumpgraph dumpresolutions compliancenotice_bom compliancenotice_shippedlibs
Test: m out/target/product/bonito/obj/NOTICE.xml.gz

Change-Id: I6282c647a389c5935d5ce7c79193f86d32c76365
This commit is contained in:
Bob Badour
2022-03-22 13:05:19 -07:00
parent fb042449e0
commit c778e4cba4
23 changed files with 109 additions and 56 deletions

View File

@@ -20,6 +20,8 @@ import (
"os"
"strings"
"testing"
"android/soong/tools/compliance"
)
func TestMain(m *testing.M) {
@@ -40,6 +42,7 @@ func Test(t *testing.T) {
tests := []struct {
condition string
name string
outDir string
roots []string
expectedOut []projectShare
}{
@@ -481,7 +484,7 @@ func Test(t *testing.T) {
for _, r := range tt.roots {
rootFiles = append(rootFiles, "testdata/"+tt.condition+"/"+r)
}
err := listShare(stdout, stderr, rootFiles...)
err := listShare(stdout, stderr, compliance.GetFS(tt.outDir), rootFiles...)
if err != nil {
t.Fatalf("listshare: error = %v, stderr = %v", err, stderr)
return