Skip to content

Commit

Permalink
stubs: builder: print really long lines to stdout
Browse files Browse the repository at this point in the history
Helps to fix the bug long lines being corrupted.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  • Loading branch information
kvalo committed Feb 20, 2024
1 parent dc894a0 commit 4870f64
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmdtests/cmd-build.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ Deferred : 6
Total : 32
master@data > build
build
CC foo.c CC bar.c CC aaa.c CC bbb.c Build successful
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 CC foo.c CC bar.c CC aaa.c CC bbb.c Build successful
master@data > quit
Expand Down
2 changes: 1 addition & 1 deletion cmdtests/cmd-commit-build-failure-accept.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ commit 1
commit All/aBort? a
a
Committing patches (1/1)
CC foo.c CC bar.c CC aaa.c CC bbb.c
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 CC foo.c CC bar.c CC aaa.c CC bbb.c
Build failed: 1
============================================================
1 patches applied:
Expand Down
2 changes: 1 addition & 1 deletion cmdtests/cmd-commit-build-failure.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ commit 1
commit All/aBort? a
a
Committing patches (1/1)
CC foo.c CC bar.c CC aaa.c CC bbb.c foo.c: warning: is suspicious
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 CC foo.c CC bar.c CC aaa.c CC bbb.c foo.c: warning: is suspicious
bar.c: warning: is suspicious
aaa.c: warning: is suspicious
bbb.c: warning: is suspicious
Expand Down
2 changes: 1 addition & 1 deletion cmdtests/cmd-commit-build-warnings-accept.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ commit 1
commit All/aBort? a
a
Committing patches (1/1)
CC foo.c CC bar.c CC aaa.c CC bbb.c foo.c: warning: is suspicious
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 CC foo.c CC bar.c CC aaa.c CC bbb.c foo.c: warning: is suspicious
bar.c: warning: is suspicious
aaa.c: warning: is suspicious
bbb.c: warning: is suspicious
Expand Down
2 changes: 1 addition & 1 deletion cmdtests/cmd-review-stg-build-failure-accept.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ review 1
Apply 1 patches to the pending branch? [Apply/Skip/aBort] a
a
Importing patches (1/1)
CC foo.c CC bar.c CC aaa.c CC bbb.c
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 CC foo.c CC bar.c CC aaa.c CC bbb.c
Build failed: 1
Under review/Changes requested/Rejected/New/Deferred/Superseded/aWaiting upstream/not aPplicable/rFc/aBort? u
u
Expand Down
2 changes: 1 addition & 1 deletion cmdtests/cmd-review-stg-multiple-abort.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ review 1-5
Apply 5 patches to the pending branch? [Apply/Skip/aBort] a
a
Importing patches (1/5)Importing patches (2/5)Importing patches (3/5)Importing patches (4/5)Importing patches (5/5)
CC foo.c CC bar.c CC aaa.c CC bbb.c Build successful
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 CC foo.c CC bar.c CC aaa.c CC bbb.c Build successful
Under review/Changes requested/Rejected/New/Deferred/Superseded/aWaiting upstream/not aPplicable/rFc/aBort? b
b
Aborted.
Expand Down
8 changes: 8 additions & 0 deletions stubs/builder
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def main():
# https://stackoverflow.com/questions/27067713/why-text-i-o-must-be-buffered-in-python-3
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', buffering=1)

# print really long line several times
s = ''
for i in range(20):
s += '1234567890'

for i in range(5):
sys.stdout.write(s + '\n')

filenames = ['foo.c', 'bar.c', 'aaa.c', 'bbb.c']
for filename in filenames:
sys.stdout.write(' CC %s\n' % (filename))
Expand Down
15 changes: 15 additions & 0 deletions stubs/cmdtests/builder.stdout
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
CC foo.c
CC bar.c
CC aaa.c
CC bbb.c
* print two warnings
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
CC foo.c
CC bar.c
CC aaa.c
CC bbb.c
* set warning count one above the limit
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
CC foo.c
CC bar.c
CC aaa.c
Expand Down

0 comments on commit 4870f64

Please sign in to comment.