Add diag() for Bash tests. Diag 'ollect_mysql_info.t find_my_cnf_file gets the correct file' when it fails.

This commit is contained in:
Daniel Nichter
2012-08-22 14:50:11 -06:00
parent f8a0eaaa7d
commit 9674c6ad88
2 changed files with 12 additions and 0 deletions

View File

@@ -211,6 +211,17 @@ wait_for_files() {
done
}
diag() {
if [ $# -eq 1 -a -f "$1" ]; then
echo "# $1:"
awk '{print "# " $0}' "$1"
else
for line in "$@"; do
echo "# $line"
done
fi
}
# ############################################################################
# Script starts here
# ############################################################################