summaryrefslogtreecommitdiff
path: root/ui/terminal/status_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2019-06-11 23:01:36 -0700
committer Colin Cross <ccross@android.com> 2019-06-12 21:30:56 -0700
commit49036be4076851c4ef2003339ffd1bf022dfc844 (patch)
treedcc907dc86c4a003e6e1a1f1181cb36d924f8637 /ui/terminal/status_test.go
parent00bdfd8476b031fb862cbfef1f122d7bff1e0acd (diff)
Use SIGWINCH to update terminal size
Instead of reading the terminal size on every status update, register for SIGWINCH to read and store the size when it changes. Test: status_test.go Change-Id: I555ad21a31a2c924ab0ca681e0c8f00df42a370a
Diffstat (limited to 'ui/terminal/status_test.go')
-rw-r--r--ui/terminal/status_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/terminal/status_test.go b/ui/terminal/status_test.go
index a87a7f07d..fc9315b96 100644
--- a/ui/terminal/status_test.go
+++ b/ui/terminal/status_test.go
@@ -17,6 +17,7 @@ package terminal
import (
"bytes"
"fmt"
+ "syscall"
"testing"
"android/soong/ui/status"
@@ -260,6 +261,8 @@ func TestSmartStatusOutputWidthChange(t *testing.T) {
runner.startAction(action)
smart.termWidth = 30
+ // Fake a SIGWINCH
+ stat.(*smartStatusOutput).sigwinch <- syscall.SIGWINCH
runner.finishAction(result)
stat.Flush()