fixes excessive newlines in testament's output (#11351)
This commit is contained in:
parent
d654383a8e
commit
f79b6dee33
1 changed files with 18 additions and 12 deletions
|
|
@ -146,7 +146,8 @@ proc callCompiler(cmdTemplate, filename, options: string,
|
||||||
var tmpl = ""
|
var tmpl = ""
|
||||||
var x = newStringOfCap(120)
|
var x = newStringOfCap(120)
|
||||||
result.nimout = ""
|
result.nimout = ""
|
||||||
while outp.readLine(x.TaintedString) or running(p):
|
while true:
|
||||||
|
if outp.readLine(x.TaintedString):
|
||||||
result.nimout.add(x & "\n")
|
result.nimout.add(x & "\n")
|
||||||
if x =~ pegOfInterest:
|
if x =~ pegOfInterest:
|
||||||
# `err` should contain the last error/warning message
|
# `err` should contain the last error/warning message
|
||||||
|
|
@ -156,6 +157,8 @@ proc callCompiler(cmdTemplate, filename, options: string,
|
||||||
tmpl = x
|
tmpl = x
|
||||||
elif x =~ pegSuccess:
|
elif x =~ pegSuccess:
|
||||||
suc = x
|
suc = x
|
||||||
|
elif not running(p):
|
||||||
|
break
|
||||||
close(p)
|
close(p)
|
||||||
result.msg = ""
|
result.msg = ""
|
||||||
result.file = ""
|
result.file = ""
|
||||||
|
|
@ -193,8 +196,11 @@ proc callCCompiler(cmdTemplate, filename, options: string,
|
||||||
result.file = ""
|
result.file = ""
|
||||||
result.output = ""
|
result.output = ""
|
||||||
result.line = -1
|
result.line = -1
|
||||||
while outp.readLine(x.TaintedString) or running(p):
|
while true:
|
||||||
|
if outp.readLine(x.TaintedString):
|
||||||
result.nimout.add(x & "\n")
|
result.nimout.add(x & "\n")
|
||||||
|
elif not running(p):
|
||||||
|
break
|
||||||
close(p)
|
close(p)
|
||||||
if p.peekExitCode == 0:
|
if p.peekExitCode == 0:
|
||||||
result.err = reSuccess
|
result.err = reSuccess
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue