mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
tool/run: Let grep_output strip colors from output
This commit is contained in:
parent
5059f2e0b6
commit
01c5226ef1
24
tool/run
24
tool/run
@ -129,6 +129,24 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Remove color information from output
|
||||
#
|
||||
proc filter_out_color_escape_sequences { } {
|
||||
global output
|
||||
regsub -all {\e\[.*?m} $output "" output
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Remove superfluous empty lines and unify line endings from output
|
||||
#
|
||||
proc trim_lines { } {
|
||||
global output
|
||||
regsub -all {[\r\n]+} $output "\n" output
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Filter output based on the specified pattern
|
||||
#
|
||||
@ -136,7 +154,11 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
|
||||
#
|
||||
proc grep_output {pattern} {
|
||||
global output
|
||||
regsub -all {[\r\n]+} $output "\n" output
|
||||
|
||||
filter_out_color_escape_sequences
|
||||
|
||||
trim_lines
|
||||
|
||||
set output_list [split $output "\n"]
|
||||
set filtered ""
|
||||
foreach line $output_list {
|
||||
|
Loading…
Reference in New Issue
Block a user