deb-m-a-dep-check/debian/rules

27 lines
934 B
Text
Raw Permalink Normal View History

2016-08-16 07:36:10 +00:00
#!/bin/bash
set -u
2016-08-16 07:36:10 +00:00
set -o pipefail
[ "$1" = binary ] || exit 0
./generate_testcases.sh | xargs --max-args=8 ./check.sh 2>../buildlog.txt | tee ../results.txt
if [ $? -ne 0 ]; then
echo "Generating the testcases failed. The last 10 lines from the stderr log are:"
tail --lines=10 ../buildlog.txt
exit 1
fi
2016-08-16 07:36:10 +00:00
num_results=$(wc -l < ../results.txt)
echo "Num-Testcases: $num_results"
echo "Perc-All-Agree: $(echo "scale=2;$(grep -E ' 0 0 0$| 1 1 1$' ../results.txt | wc -l)*100/$num_results" | bc) %"
echo "Perc-Dose-Apt-Agree: $(echo "scale=2;$(grep -E ' 0 0 .$| 1 1 .$' ../results.txt | wc -l)*100/$num_results" | bc) %"
echo "Perc-Dose-Dpkg-Agree: $(echo "scale=2;$(grep -E ' 0 . 0$| 1 . 1$' ../results.txt | wc -l)*100/$num_results" | bc) %"
echo "Perc-Apt-Dpkg-Agree: $(echo "scale=2;$(grep -E ' . 0 0$| . 1 1$' ../results.txt | wc -l)*100/$num_results" | bc) %"
2016-08-16 10:45:00 +00:00
cat << END > debian/files
buildlog.txt - -
results.txt - -
END