diff options
author | Simon Glass <sjg@chromium.org> | 2016-02-24 09:14:47 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-02-26 08:53:10 -0700 |
commit | f91281b1eb8897cb49a395666aa58ae4c8c62c6c (patch) | |
tree | d8796d2690e47b84960d65dcad212a7db58ea303 /test | |
parent | 83cc112e82fea5f521a3bf6334dce6e6c56ef0e6 (diff) | |
download | u-boot-f91281b1eb8897cb49a395666aa58ae4c8c62c6c.tar.gz u-boot-f91281b1eb8897cb49a395666aa58ae4c8c62c6c.tar.bz2 u-boot-f91281b1eb8897cb49a395666aa58ae4c8c62c6c.zip |
trace: Improve the trace test number recognition
The awk tool can be confused by return character (ASCII 13) in its input
since it thinks there is a separate field. These can appear if the terminal
is in raw mode, perhaps due to a previous U-Boot crash with sandbox. This
is very confusing. Remove these so that the trace test passes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rwxr-xr-x | test/trace/test-trace.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/trace/test-trace.sh b/test/trace/test-trace.sh index 3e8651ed60..746793c83b 100755 --- a/test/trace/test-trace.sh +++ b/test/trace/test-trace.sh @@ -45,7 +45,9 @@ check_results() { # between calls 2 and 3, where tracing is paused. # This code gets the sign of the difference between each number and # its predecessor. - counts="$(tr -d , <${tmp} | awk '/traced function calls/ { diff = $1 - upto; upto = $1; printf "%d ", diff < 0 ? -1 : (diff > 0 ? 1 : 0)}')" + counts="$(tr -d ',\r' <${tmp} | awk \ + '/traced function calls/ { diff = $1 - upto; upto = $1; \ + printf "%d ", diff < 0 ? -1 : (diff > 0 ? 1 : 0)}')" if [ "${counts}" != "1 1 0 1 " ]; then fail "trace collection error: ${counts}" |