diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 11:26:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 11:26:17 +0000 |
commit | 5df6c2aefebe3d2abcc939a88e294876d59f03ca (patch) | |
tree | 63fb332a0f21ddb91cb789c80cf64e134d373463 /testsuite/stats.sh | |
parent | Initial commit. (diff) | |
download | po4a-5df6c2aefebe3d2abcc939a88e294876d59f03ca.tar.xz po4a-5df6c2aefebe3d2abcc939a88e294876d59f03ca.zip |
Adding upstream version 0.72.upstream/0.72
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testsuite/stats.sh')
-rwxr-xr-x | testsuite/stats.sh | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/testsuite/stats.sh b/testsuite/stats.sh new file mode 100755 index 0000000..d330106 --- /dev/null +++ b/testsuite/stats.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +# see the 'check' script for the meaning of the categories. +# You can tune the order of the categories to have all improvement in the +# upper right or lower left corner of the table. +types="IGN OK OK2 WOK1 WOK2 WOK3 PBS WDIFF" + +if [ "$#" != "2" ] ; then + echo "\ +Compare two executions of the 'check' script, and display the results in a +table. + +Usage: $0 <directory1> <directory2> +Were both directories contain the results (LISTE.* files) of two 'check' +executions. + +The categories are configurable at the beginning of $0. + +$0 creates, in the stats_work directory, files named cat1_cat2, which +indicate which man pages changed from the cat1 category to the cat2 one. +" + exit 0 +fi + +old=$1 +new=$2 +[ -d stats_work ] || mkdir stats_work + +# copy the LISTE.* files in stats_work +for i in $types +do + sort $old/LISTE.$i > stats_work/old_$i + sort $new/LISTE.$i > stats_work/new_$i +done + +# create the cat1_cat2 files which contain the common lines of two +# categories. +for i in $types +do + for j in $types + do + cat stats_work/old_$i stats_work/new_$j | sort | uniq -d > stats_work/"$i"_"$j" + done +done + +# display the report +echo "dir1:$old" +echo "dir2:$new" +echo +echo -n "dir1\\dir2" +for i in $types +do + printf "% 6s" $i +done +echo +for i in $types +do + printf "% 9s" $i + for j in $types + do + printf "% 6d" $(wc -l stats_work/"$i"_"$j"|cut -d" " -f1) + done + echo +done +echo -n "total: " $(for i in $types; do cat stats_work/old_$i; done | wc -l) +echo " |" $(for i in $types; do cat stats_work/new_$i; done | wc -l) |