presubmit: Check errorf as well (#1845)

Uppercase all these test errors as well. And extend the presubmit to
check for these in the future. Also do a slightly smarter grep to only
get t.<something>. as (because dump regexp) this also grep over non test
files.
This commit is contained in:
Miek Gieben
2018-06-02 19:48:39 +01:00
committed by Yong Tang
parent 3994d3a5a7
commit 22c0b30d5f
19 changed files with 57 additions and 52 deletions

View File

@@ -3,12 +3,17 @@
echo "** presubmit/$(basename $0)"
# Get the tests that call t.* without capitalizing the first char - seems we standardized on that.
if egrep -r 't\.Fatal.?\("[a-z]' "$@"; then
if egrep -r '\bt\.Fatal.?\("[a-z]' "$@"; then
echo "** presubmit/$(basename $0): please start with an upper case letter when using t.Fatal*()"
exit 1
fi
if egrep -r 't\.Log.?\("[a-z]' "$@"; then
if egrep -r '\bt\.Error.?\("[a-z]' "$@"; then
echo "** presubmit/$(basename $0): please start with an upper case letter when using t.Error*()"
exit 1
fi
if egrep -r '\bt\.Log.?\("[a-z]' "$@"; then
echo "** presubmit/$(basename $0): please start with an upper case letter when using t.Log*()"
exit 1
fi