From 4620d46bf0aa00df3857a5883b790da3d12995dd Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:16:00 -0600 Subject: patman: Fix up the test comments Many of the tests have the same comment and two have the same name. Fix this. Signed-off-by: Simon Glass --- tools/patman/test_checkpatch.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/patman/test_checkpatch.py') diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py index c9580adb544..9d233f99aee 100644 --- a/tools/patman/test_checkpatch.py +++ b/tools/patman/test_checkpatch.py @@ -373,19 +373,19 @@ index 0000000..2234c87 self.checkSingleMessage(pm, 'NEW_UCLASS') def testLivetree(self): - """Test for Use the livetree API""" + """Test for using the livetree API""" pm = PatchMaker() pm.add_line('common/main.c', 'fdtdec_do_something()') self.checkSingleMessage(pm, 'LIVETREE') def testNewCommand(self): - """Test for Use the livetree API""" + """Test for adding a new command""" pm = PatchMaker() pm.add_line('common/main.c', 'do_wibble(struct cmd_tbl *cmd_tbl)') self.checkSingleMessage(pm, 'CMD_TEST') - def testNewCommand(self): - """Test for Use the livetree API""" + def testPreferIf(self): + """Test for using #ifdef""" pm = PatchMaker() pm.add_line('common/main.c', '#ifdef CONFIG_YELLOW') pm.add_line('common/init.h', '#ifdef CONFIG_YELLOW') @@ -393,7 +393,7 @@ index 0000000..2234c87 self.checkSingleMessage(pm, "PREFER_IF") def testCommandUseDefconfig(self): - """Test for Use the livetree API""" + """Test for enabling/disabling commands using preprocesor""" pm = PatchMaker() pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH') self.checkSingleMessage(pm, 'DEFINE_CONFIG_CMD', 'error') -- cgit v1.2.3 From 23552ba142860205c4ddec414417cdc251f8cb79 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 19 Jul 2020 10:16:01 -0600 Subject: checkpatch: Don't allow common.h and dm.h in headers These headers should not be included in other header files. Add a checkpatch rule and test for this. Signed-off-by: Simon Glass --- tools/patman/test_checkpatch.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/patman/test_checkpatch.py') diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py index 9d233f99aee..792196e6896 100644 --- a/tools/patman/test_checkpatch.py +++ b/tools/patman/test_checkpatch.py @@ -398,6 +398,13 @@ index 0000000..2234c87 pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH') self.checkSingleMessage(pm, 'DEFINE_CONFIG_CMD', 'error') + def testBarredIncludeInHdr(self): + """Test for using a barred include in a header file""" + pm = PatchMaker() + #pm.add_line('include/myfile.h', '#include ') + pm.add_line('include/myfile.h', '#include ') + self.checkSingleMessage(pm, 'BARRED_INCLUDE_IN_HDR', 'error') + if __name__ == "__main__": unittest.main() -- cgit v1.2.3