tests: Handle sed which append a trailing newline.

This commit is contained in:
Simon Ruderich
2013-07-01 03:20:38 +02:00
parent b926752fac
commit abd557a42f
11 changed files with 14 additions and 4 deletions

View File

@@ -7,3 +7,4 @@ write to stderr 2<STDERR<write to stdout 2>STDERR>
stderr ...
<STDERR<more on stdout
>STDERR>x<STDERR<
EOF

View File

@@ -7,3 +7,4 @@ more on stderr
stderr ...
more on stdout
x
EOF

View File

@@ -9,3 +9,4 @@
>STDERR>example_err: warning: message: Cannot allocate memory
example_err: warning: message
<STDERR<
EOF

View File

@@ -7,4 +7,4 @@ PROG<message>
PROGfile:42: <message>
PROG<message>: Cannot allocate memory
PROGfile:42: <message>: Cannot allocate memory
<STDERR<
<STDERR<EOF

View File

@@ -123,3 +123,4 @@ environ[0] = |COLORED_STDERR_PRIVATE_FDS=2,|
environ[1] = |TEST=55|
Done.
EOF

View File

@@ -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

View File

@@ -5,4 +5,4 @@
write to stderr which gets redirected to stdout
write to stdout 3
>STDERR>another redirect to stderr
<STDERR<
<STDERR<EOF

View File

@@ -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

View File

@@ -26,3 +26,4 @@ z
>STDERR>fputs_unlocked()<STDERR<
>STDERR>x<STDERR<
>STDERR>y<STDERR<
EOF

View File

@@ -1,3 +1,4 @@
>STDERR>Before vfork().
After vfork().
<STDERR<
EOF

View File

@@ -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"