mirror of
https://github.com/FAUSheppy/colorredstderr-mirror
synced 2025-12-09 16:38:32 +01:00
tests: Handle sed which append a trailing newline.
This commit is contained in:
@@ -7,3 +7,4 @@ write to stderr 2<STDERR<write to stdout 2>STDERR>
|
||||
stderr ...
|
||||
<STDERR<more on stdout
|
||||
>STDERR>x<STDERR<
|
||||
EOF
|
||||
|
||||
@@ -7,3 +7,4 @@ more on stderr
|
||||
stderr ...
|
||||
more on stdout
|
||||
x
|
||||
EOF
|
||||
|
||||
@@ -9,3 +9,4 @@
|
||||
>STDERR>example_err: warning: message: Cannot allocate memory
|
||||
example_err: warning: message
|
||||
<STDERR<
|
||||
EOF
|
||||
|
||||
@@ -7,4 +7,4 @@ PROG<message>
|
||||
PROGfile:42: <message>
|
||||
PROG<message>: Cannot allocate memory
|
||||
PROGfile:42: <message>: Cannot allocate memory
|
||||
<STDERR<
|
||||
<STDERR<EOF
|
||||
|
||||
@@ -123,3 +123,4 @@ environ[0] = |COLORED_STDERR_PRIVATE_FDS=2,|
|
||||
environ[1] = |TEST=55|
|
||||
|
||||
Done.
|
||||
EOF
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
write to stdout
|
||||
write to stderr
|
||||
write to stdout without newlinewrite to stderr without newline
|
||||
write to stdout without newlinewrite to stderr without newlineEOF
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
write to stderr which gets redirected to stdout
|
||||
write to stdout 3
|
||||
>STDERR>another redirect to stderr
|
||||
<STDERR<
|
||||
<STDERR<EOF
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
write to stdout
|
||||
>STDERR>write to stderr
|
||||
<STDERR<write to stdout without newline>STDERR>write to stderr without newline<STDERR<
|
||||
<STDERR<write to stdout without newline>STDERR>write to stderr without newline<STDERR<EOF
|
||||
|
||||
@@ -26,3 +26,4 @@ z
|
||||
>STDERR>fputs_unlocked()<STDERR<
|
||||
>STDERR>x<STDERR<
|
||||
>STDERR>y<STDERR<
|
||||
EOF
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
>STDERR>Before vfork().
|
||||
After vfork().
|
||||
<STDERR<
|
||||
EOF
|
||||
|
||||
@@ -99,6 +99,10 @@ run_test() {
|
||||
$valgrind_cmd "$@" "$testcase" > "$output" 2>&1
|
||||
)
|
||||
|
||||
# Some sed implementations (e.g. on FreeBSD 9.1) always append a trailing
|
||||
# newline. Add "EOF" to detect if the real output had one.
|
||||
echo EOF >> "$output"
|
||||
|
||||
# Merge continuous regions of colored output. The exact calls don't matter
|
||||
# as long as the output is colored.
|
||||
sed 's/<STDERR<>STDERR>//g' < "$output" > "$output.tmp"
|
||||
|
||||
Reference in New Issue
Block a user