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
diff --git a/tools/compliance/cmd/bom/bom_test.go b/tools/compliance/cmd/bom/bom_test.go
index 4a9889f..87a3b50 100644
--- a/tools/compliance/cmd/bom/bom_test.go
+++ b/tools/compliance/cmd/bom/bom_test.go
@@ -21,6 +21,8 @@
"os"
"strings"
"testing"
+
+ "android/soong/tools/compliance"
)
func TestMain(m *testing.M) {
@@ -37,6 +39,7 @@
tests := []struct {
condition string
name string
+ outDir string
roots []string
stripPrefix string
expectedOut []string
@@ -282,7 +285,7 @@
rootFiles = append(rootFiles, "testdata/"+tt.condition+"/"+r)
}
- ctx := context{stdout, stderr, os.DirFS("."), []string{tt.stripPrefix}}
+ ctx := context{stdout, stderr, compliance.GetFS(tt.outDir), []string{tt.stripPrefix}}
err := billOfMaterials(&ctx, rootFiles...)
if err != nil {