diff options
author | Arthur She <arthur.she@linaro.org> | 2015-07-06 13:50:57 +0800 |
---|---|---|
committer | Arthur She <arthur.she@linaro.org> | 2015-07-07 10:03:13 +0800 |
commit | 1f86b3de0620055a9c5f39f4ab43b2c0d2078e00 (patch) | |
tree | d99188059f1eeb6fde2c16a017fe1256ee0d9c04 /ubuntu/scripts/rt-tests-parser.sh | |
parent | 08995535249692f408b98238617eb9bb568f3260 (diff) |
ubuntu/scripts/rt-tests-parser.sh
Correct the test case id in test result and make it work for both
Ubuntu and OE.
Change-Id: I3f15bb19dfe4681f70ffa8a71d58e8ba0d78ece7
Diffstat (limited to 'ubuntu/scripts/rt-tests-parser.sh')
-rwxr-xr-x | ubuntu/scripts/rt-tests-parser.sh | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/ubuntu/scripts/rt-tests-parser.sh b/ubuntu/scripts/rt-tests-parser.sh index b5cea6e..e86c931 100755 --- a/ubuntu/scripts/rt-tests-parser.sh +++ b/ubuntu/scripts/rt-tests-parser.sh @@ -1,39 +1,23 @@ #!/bin/sh -LOG=$1 +TESTNAME=$1 +LOG=$2 # Find the last line number which starting with control character -N=`grep -n "#0:" ${LOG} | tail -n1 | cut -d':' -f1` -# The rest of lines from #N is the final test result we want -sed -i "s/\x1b\[[0-9]A//" ${LOG} # Remove the control code +N=`grep -n "^#1 -> #0" ${LOG} | tail -n1 | cut -d':' -f1` sed -n "${N},$ p" ${LOG} > tmp.log -mv tmp.log ${LOG} -sed "s/.*> //" ${LOG} | sed "s/^#/A/" > tmp.log - -grep "CPU" tmp.log > v.log -grep -v "CPU" tmp.log > res.log -while read l; -do - k="`echo ${l} | cut -d: -f1`" - v="`echo ${l} | cut -d, -f3|sed 's/^ //'`" - eval ${k}=${v} - while read m; - do - eval sed -i "s/${k}/\$${k}/" res.log - done < res.log -done < v.log while read l do TC="`echo ${l} | cut -d',' -f1`" - R="`echo ${l} | sed 's/^CPU[0-9]*, //'`" + R="`echo ${l} | cut -d',' -f2-`" IFS=',' for c in ${R} do c="`echo $c|sed 's/^[ ]*//'`" t="`echo ${c} | cut -d' ' -f1`" v="`echo ${c} | cut -d' ' -f2`" - echo "${TC}_${t}: ${v} usec pass" + echo "${TESTNAME} ${TC} (${t}): ${v} usec pass" done unset IFS -done < res.log +done < tmp.log |