diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2020-06-30 08:41:29 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2020-06-30 08:41:29 +0000 |
commit | 3938b43bbef6d6691a0cf5ac2c5003e66f1f4476 (patch) | |
tree | ea8ebe858452c28b7d4034afe4427c58be9f35a6 | |
parent | 924cce4360a9038e5740aba48b29d5b50783e628 (diff) |
compare_tests: Add -compr option
This allows to select how the .sum files are compressed.
It defaults to .xz (what we use in most jobs), but '-compr none'
allows to handle uncompressed sum files, for instance when running
this script right after a GCC build like we do in round-robin jobs.
Change-Id: I5f7085b16a65a470c27ad682be74a6cb8d2e496e
-rwxr-xr-x | compare_tests | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/compare_tests b/compare_tests index 97b44bd..ac9c8df 100755 --- a/compare_tests +++ b/compare_tests @@ -13,7 +13,7 @@ usage() echo >&2 fi cat >&2 <<EOUSAGE -Usage: $0 [-target target-triplet] [-pass-thresh pass-ratio-threshold] PREVIOUS CURRENT +Usage: $0 [-target target-triplet] [-pass-thresh pass-ratio-threshold] [-compr compression-type] PREVIOUS CURRENT Compare the PREVIOUS and CURRENT test case .sum files, reporting anything of interest. @@ -26,6 +26,10 @@ Compare the PREVIOUS and CURRENT test case .sum files, reporting anything of int -pass-thresh controls the level of warning when too few tests pass. + -compr controls the compression type used when searching for + the .sum files. Defaults to xz, use 'none' for uncompressed + .sum files. + Exit with the following values: 0 if there is nothing of interest 1 if there are improvements @@ -56,6 +60,8 @@ lst5=/tmp/$tool-lst5.$$ sum1=/tmp/$tool-sum1.$$ sum2=/tmp/$tool-sum2.$$ tmps="$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2" +compr="xz" +compr_suffix=".xz" while [ $# -gt 2 ] do @@ -68,6 +74,15 @@ do pass_thresh=$2 shift 2 ;; + "-compr") + compr=$2 + compr_suffix=".$2" + shift 2 + if [ x"$compr" = xnone ]; then + compr="" + compr_suffix="" + fi + ;; "-?") usage ;; @@ -86,8 +101,8 @@ trap "rm -f $tmps" 0 1 2 3 5 9 13 15 exit_status=0 if [ -d "$1" -a -d "$2" ] ; then - find "$1/" \( -name '*.sum.xz' \)>$lst1 - find "$2/" \( -name '*.sum.xz' \)>$lst2 + find "$1/" \( -name "*.sum${compr_suffix}" \)>$lst1 + find "$2/" \( -name "*.sum${compr_suffix}" \)>$lst2 echo "# Comparing directories" echo "# REFERENCE: $1" echo "# CURRENT: $2" @@ -119,13 +134,13 @@ if [ -d "$1" -a -d "$2" ] ; then echo "# Comparing $cmnsums common sum files:" cat $lst5 ( for fname in `cat $lst5`; do - bname=`basename $fname .sum.xz` - xzcat $1/$fname | sed -e "s/^\([A-Z]*: \)/\1 $bname:/" | sed -r 's:of file /home.*/gcc/:of file :;s:==[0-9]+==:==X==:;s/output pattern test,.*$/output pattern XXX/' \ + bname=`basename $fname .sum${compr_suffix}` + ${compr}cat $1/$fname | sed -e "s/^\([A-Z]*: \)/\1 $bname:/" | sed -r 's:of file /home.*/gcc/:of file :;s:==[0-9]+==:==X==:;s/output pattern test,.*$/output pattern XXX/' \ | sed -e "s|^\([A-Z]*: \).*/home/.*/testsuite/|\1|" done ) >$sum1 ( for fname in `cat $lst5`; do - bname=`basename $fname .sum.xz` - xzcat $2/$fname | sed -e "s/^\([A-Z]*: \)/\1 $bname:/" | sed -r 's:of file /home.*/gcc/:of file :;s:==[0-9]+==:==X==:;s/output pattern test,.*$/output pattern XXX/' \ + bname=`basename $fname .sum${compr_suffix}` + ${compr}cat $2/$fname | sed -e "s/^\([A-Z]*: \)/\1 $bname:/" | sed -r 's:of file /home.*/gcc/:of file :;s:==[0-9]+==:==X==:;s/output pattern test,.*$/output pattern XXX/' \ | sed -e "s|^\([A-Z]*: \).*/home/.*/testsuite/|\1|" done ) >$sum2 if [ "x${target}" != "x" ] ; then |