[2/2] devtools: check for tests added without a test suite
Checks
Commit Message
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 <bruce.richardson@intel.com>
---
devtools/checkpatches.sh | 8 ++++++++
1 file changed, 8 insertions(+)
@@ -159,6 +159,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' \