summaryrefslogtreecommitdiff
path: root/util/presubmit_check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/presubmit_check.sh')
-rwxr-xr-xutil/presubmit_check.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/presubmit_check.sh b/util/presubmit_check.sh
index 0fcd4a3319..b6ffa80a35 100755
--- a/util/presubmit_check.sh
+++ b/util/presubmit_check.sh
@@ -19,3 +19,11 @@ if git diff --no-ext-diff "${upstream_branch}" HEAD |
echo "error: CPRINTS strings should not include newline characters" >&2
exit 1
fi
+
+# Check for missing 'test_' prefix from ZTEST definitions
+if git diff --no-ext-diff "${upstream_branch}" HEAD |
+ pcregrep -M "^\+(ZTEST|ZTEST_F|ZTEST_USER|ZTEST_USER_F)\(\w+,[\n\+|\s]*\w+\)" |
+ pcregrep -vM "\(\w+,[\n\+]*\s*test_\w+\)"; then
+ echo "error: 'test_' prefix missing from test function name" >&2
+ exit 1
+fi