Add environment variable to force keeping ANSI codes
If SOONG_UI_ANSI_OUTPUT is set to a true value force the simple status output to keep ANSI codes. This will allow buildbots to collect logs with ANSI codes in them. Smart status output is not affected as it always keeps ANSI codes. Bug: 147310922 Test: manual Change-Id: I0b78ceebb65125b8e8dafb4787816fb679d3eb3e
This commit is contained in:
@@ -94,7 +94,7 @@ func TestStatusOutput(t *testing.T) {
|
||||
|
||||
t.Run("smart", func(t *testing.T) {
|
||||
smart := &fakeSmartTerminal{termWidth: 40}
|
||||
stat := NewStatusOutput(smart, "", false, false)
|
||||
stat := NewStatusOutput(smart, "", false, false, false)
|
||||
tt.calls(stat)
|
||||
stat.Flush()
|
||||
|
||||
@@ -105,7 +105,7 @@ func TestStatusOutput(t *testing.T) {
|
||||
|
||||
t.Run("simple", func(t *testing.T) {
|
||||
simple := &bytes.Buffer{}
|
||||
stat := NewStatusOutput(simple, "", false, false)
|
||||
stat := NewStatusOutput(simple, "", false, false, false)
|
||||
tt.calls(stat)
|
||||
stat.Flush()
|
||||
|
||||
@@ -116,7 +116,7 @@ func TestStatusOutput(t *testing.T) {
|
||||
|
||||
t.Run("force simple", func(t *testing.T) {
|
||||
smart := &fakeSmartTerminal{termWidth: 40}
|
||||
stat := NewStatusOutput(smart, "", true, false)
|
||||
stat := NewStatusOutput(smart, "", true, false, false)
|
||||
tt.calls(stat)
|
||||
stat.Flush()
|
||||
|
||||
@@ -269,7 +269,7 @@ func TestSmartStatusOutputWidthChange(t *testing.T) {
|
||||
os.Setenv(tableHeightEnVar, "")
|
||||
|
||||
smart := &fakeSmartTerminal{termWidth: 40}
|
||||
stat := NewStatusOutput(smart, "", false, false)
|
||||
stat := NewStatusOutput(smart, "", false, false, false)
|
||||
smartStat := stat.(*smartStatusOutput)
|
||||
smartStat.sigwinchHandled = make(chan bool)
|
||||
|
||||
|
Reference in New Issue
Block a user