mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 09:54:35 +00:00
checkpatch.pl: Add a check for tests needed for uclasses
A common problem when submitting a new uclass is to forget to add sandbox tests. Add a warning for this. Of course tests should always be added for new code, but this one seems to be missed by nearly every new contributor. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
b77df5980c
commit
281236c728
1 changed files with 6 additions and 0 deletions
|
@ -2243,6 +2243,12 @@ sub pos_last_openparen {
|
||||||
# Checks specific to U-Boot
|
# Checks specific to U-Boot
|
||||||
sub u_boot_line {
|
sub u_boot_line {
|
||||||
my ($realfile, $line, $herecurr) = @_;
|
my ($realfile, $line, $herecurr) = @_;
|
||||||
|
|
||||||
|
# ask for a test if a new uclass ID is added
|
||||||
|
if ($realfile =~ /uclass-id.h/ && $line =~ /^\+/) {
|
||||||
|
WARN("NEW_UCLASS",
|
||||||
|
"Possible new uclass - make sure to add a sandbox driver, plus a test in test/dm/<name>.c\n" . $herecurr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub process {
|
sub process {
|
||||||
|
|
Loading…
Add table
Reference in a new issue