1#! /bin/bash 2# Basic count stats from the VU database in CSV format for spreadsheet loading. 3# Usage: ./vu_csv_stats.sh > stats.csv 4 5set -o errexit 6set -o nounset 7 8COUNT="grep -c" 9 10INFILE="./vk_validation_error_database.txt" 11 12if [ ! -r "$INFILE" ] 13then 14 echo "ERROR: \"$INFILE\" is not readable." >&2 15 exit 1 16fi 17 18echo "\"Generated\",\"`date`\"" 19echo "\"Directory\",\"`pwd -P`\"" 20echo "\"Commit\",\"$(git describe --all --long)\"" 21echo 22echo "\"All VUs\"" 23echo "\"\",\"Total\",$($COUNT '^VALIDATION_ERROR_' $INFILE)" 24echo "\"\",\"Done (Y)\",$($COUNT '~^~Y~^~' $INFILE)" 25echo "\"\",\"Not done (N)\",$($COUNT '~^~N~^~' $INFILE)" 26echo "\"\",\"Unknown (U)\",$($COUNT '~^~U~^~' $INFILE)" 27echo 28echo "\"Implicit VUs\"" 29echo "\"\",\"Total\",$($COUNT 'implicit' $INFILE)" 30echo "\"\",\"Done (Y)\",$(grep 'implicit' $INFILE | $COUNT '~^~Y~^~')" 31echo "\"\",\"Not done (N)\",$(grep 'implicit' $INFILE | $COUNT '~^~N~^~')" 32echo 33echo "\"Tests\"" 34echo "\"\",\"None\",$($COUNT '~^~None~^~' $INFILE)" 35echo "\"\",\"Unknown\",$($COUNT '~^~Unknown~^~' $INFILE)" 36echo "\"\",\"NotTestable\",$($COUNT '~^~NotTestable~^~' $INFILE)" 37 38# vim: set sw=4 ts=8 et ic ai: 39