tools/mpremote: Make sure stdout and stderr output appear in order.
mpremote error messages now go to stderr, so make sure stdout is flushed before printing them. Also update the test runner to capture error messages. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
72799f9973
commit
c1a85bb6de
@ -547,7 +547,10 @@ def main():
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
except CommandError as e:
|
except CommandError as e:
|
||||||
|
# Make sure existing stdout appears before the error message on stderr.
|
||||||
|
sys.stdout.flush()
|
||||||
print(f"{_PROG}: {e}", file=sys.stderr)
|
print(f"{_PROG}: {e}", file=sys.stderr)
|
||||||
|
sys.stderr.flush()
|
||||||
return 1
|
return 1
|
||||||
finally:
|
finally:
|
||||||
do_disconnect(state)
|
do_disconnect(state)
|
||||||
|
|||||||
@ -16,7 +16,7 @@ for t in $TESTS; do
|
|||||||
TMP=$(mktemp -d)
|
TMP=$(mktemp -d)
|
||||||
echo -n "${t}: "
|
echo -n "${t}: "
|
||||||
# Strip CR and replace the random temp dir with a token.
|
# Strip CR and replace the random temp dir with a token.
|
||||||
if env MPREMOTE=${MPREMOTE} TMP="${TMP}" "${t}" | tr -d '\r' | sed "s,${TMP},"'${TMP},g' > "${t}.out"; then
|
if env MPREMOTE=${MPREMOTE} TMP="${TMP}" "${t}" 2>&1 | tr -d '\r' | sed "s,${TMP},"'${TMP},g' > "${t}.out"; then
|
||||||
if diff "${t}.out" "${t}.exp" > /dev/null; then
|
if diff "${t}.out" "${t}.exp" > /dev/null; then
|
||||||
echo "OK"
|
echo "OK"
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user