Merge stdout/stderr in the same output

In this way we can print() lines from Lua + debug use TRACE() lines
from code to test/debug.
This commit is contained in:
David Capello 2020-08-07 13:12:08 -03:00
parent 8adc0b8832
commit e08f4f5827

View File

@ -46,7 +46,7 @@ if [[ "$filter" == "" ]] || [[ "console" =~ $filter ]]; then
echo ---------------------------------------------------------------------- echo ----------------------------------------------------------------------
echo "Testing console..." echo "Testing console..."
$ASEPRITE -b --script scripts/console_assert.lua >$t/tmp 2>$t/tmp_err $ASEPRITE -b --script scripts/console_assert.lua >$t/tmp 2>&1
! grep -q "this should be in the output" $t/tmp && fail "print() text not found in output" ! grep -q "this should be in the output" $t/tmp && fail "print() text not found in output"
! grep -q "assertion failed" $t/tmp && fail "assert() text not found in output" ! grep -q "assertion failed" $t/tmp && fail "assert() text not found in output"
grep -q "this should not be in the output" $t/tmp && fail "text that shouldn't be in the output is" grep -q "this should not be in the output" $t/tmp && fail "text that shouldn't be in the output is"
@ -54,7 +54,7 @@ if [[ "$filter" == "" ]] || [[ "console" =~ $filter ]]; then
if [[ "$(uname)" =~ "MINGW32" ]] || [[ "$(uname)" =~ "MSYS_NT-10.0" ]] ; then if [[ "$(uname)" =~ "MINGW32" ]] || [[ "$(uname)" =~ "MSYS_NT-10.0" ]] ; then
echo Ignore console tests on Windows echo Ignore console tests on Windows
else else
$ASEPRITE -b --script scripts/console_print.lua >$t/tmp 2>$t/tmp_err $ASEPRITE -b --script scripts/console_print.lua >$t/tmp 2>&1
cat >$t/tmp_expected <<EOF cat >$t/tmp_expected <<EOF
hello world hello world
1 2 3 1 2 3
@ -76,10 +76,8 @@ for script in scripts/*.lua ; do
first=1 first=1
fi fi
echo "Running $script" echo "Running $script"
if ! $ASEPRITE -b --script $script >$t/tmp 2>$t/tmp_err ; then if ! $ASEPRITE -b --script $script >$t/tmp 2>&1 ; then
echo FAILED echo FAILED && cat $t/tmp
echo STDOUT && cat $t/tmp
echo STDERR && cat $t/tmp_err
result=1 result=1
fi fi
done done