summaryrefslogtreecommitdiff
path: root/tools/patman/test_checkpatch.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-08-03 22:20:22 -0400
committerTom Rini <trini@konsulko.com>2020-08-03 22:20:22 -0400
commitd6faedca7670a0b4862cace2f3189998cbec87d8 (patch)
tree387ca6154bbfb29b7ff30946cac70036146c5cb6 /tools/patman/test_checkpatch.py
parent68941e3b2c217907a49aa66af8bb65729b913397 (diff)
parent23552ba142860205c4ddec414417cdc251f8cb79 (diff)
Merge branch '2020-08-01-misc-cleanups'
- Further cleanup of common.h and dm.h usage in headers
Diffstat (limited to 'tools/patman/test_checkpatch.py')
-rw-r--r--tools/patman/test_checkpatch.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py
index c9580adb544..792196e6896 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,11 +393,18 @@ 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')
+ def testBarredIncludeInHdr(self):
+ """Test for using a barred include in a header file"""
+ pm = PatchMaker()
+ #pm.add_line('include/myfile.h', '#include <common.h>')
+ pm.add_line('include/myfile.h', '#include <dm.h>')
+ self.checkSingleMessage(pm, 'BARRED_INCLUDE_IN_HDR', 'error')
+
if __name__ == "__main__":
unittest.main()