summaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorBruce Richardson <[email protected]>2023-09-15 12:52:06 +0100
committerDavid Marchand <[email protected]>2023-10-02 11:33:12 +0200
commit5f99480bc32b5f643fb357f8bed022b9bd23ecad (patch)
treef84db6675fd9d5d23212282148ea4fcff9b881be /devtools
parent25065ef1f6c021e7865ef41a5e3eb4845d32f062 (diff)
devtools: check for orphaned tests
Add a check in checkpatches.sh for the use of the old REGISTER_TEST_COMMAND macro, which just adds a test without including it in a test suite. Suggest to the user to add the test using the newer macros which will include the test in a test suite. Signed-off-by: Bruce Richardson <[email protected]> Reviewed-by: David Marchand <[email protected]>
Diffstat (limited to 'devtools')
-rwxr-xr-xdevtools/checkpatches.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 95b806e07d..2635923e14 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -183,6 +183,14 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
+ # prevent addition of tests not in one of our test suites
+ awk -v FOLDERS='app/test' \
+ -v EXPRESSIONS='REGISTER_TEST_COMMAND' \
+ -v RET_ON_FAIL=1 \
+ -v MESSAGE='Using REGISTER_TEST_COMMAND instead of REGISTER_<suite_name>_TEST' \
+ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+ "$1" || res=1
+
# SVG must be included with wildcard extension to allow conversion
awk -v FOLDERS='doc' \
-v EXPRESSIONS='::[[:space:]]*[^[:space:]]*\\.svg' \