mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 01:02:19 +02:00
binman: Allow creation of entry documentation
Binman supports quite a number of different entries now. The operation of these is not always obvious but at present the source code is the only reference for understanding how an entry works. Add a way to create documentation (from the source code) which can be put in a new 'README.entries' file. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -21,6 +21,7 @@ import control
|
||||
import elf
|
||||
import fdt
|
||||
import fdt_util
|
||||
import test_util
|
||||
import tools
|
||||
import tout
|
||||
|
||||
@@ -1177,6 +1178,20 @@ class TestFunctional(unittest.TestCase):
|
||||
TEXT_DATA3 + 'some text')
|
||||
self.assertEqual(expected, data)
|
||||
|
||||
def testEntryDocs(self):
|
||||
"""Test for creation of entry documentation"""
|
||||
with test_util.capture_sys_output() as (stdout, stderr):
|
||||
control.WriteEntryDocs(binman.GetEntryModules())
|
||||
self.assertTrue(len(stdout.getvalue()) > 0)
|
||||
|
||||
def testEntryDocsMissing(self):
|
||||
"""Test handling of missing entry documentation"""
|
||||
with self.assertRaises(ValueError) as e:
|
||||
with test_util.capture_sys_output() as (stdout, stderr):
|
||||
control.WriteEntryDocs(binman.GetEntryModules(), 'u_boot')
|
||||
self.assertIn('Documentation is missing for modules: u_boot',
|
||||
str(e.exception))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user