提交 28a72d65 编写于 作者: W Wei Jiangang 提交者: Andrea Bolognani

tests: make redirects happen in correct order

It should redirect stdout to /dev/null first,
then redirect stderr to whatever stdout currently points at.
Signed-off-by: NWei Jiangang <weijg.fnst@cn.fujitsu.com>
上级 1059c481
...@@ -248,9 +248,9 @@ trap '(exit $?); exit $?' 1 2 13 15 ...@@ -248,9 +248,9 @@ trap '(exit $?); exit $?' 1 2 13 15
cd "$t_" || error_ "failed to cd to $t_" cd "$t_" || error_ "failed to cd to $t_"
if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
compare() { diff -u "$@"; } compare() { diff -u "$@"; }
elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
compare() { cmp -s "$@"; } compare() { cmp -s "$@"; }
else else
compare() { cmp "$@"; } compare() { cmp "$@"; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册