diff options
author | Simon Glass <sjg@chromium.org> | 2018-07-17 13:25:36 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-08-01 16:30:48 -0600 |
commit | fd8d1f79623d2944d9ca8469a3681d53b8b277f9 (patch) | |
tree | e8faca4c85020b0d712e576f4dd23f80664d098b /tools/binman/ftest.py | |
parent | 3fb397bba01a511f8ca2b091a359495e18badd7e (diff) |
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>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r-- | tools/binman/ftest.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 696889601e..9c01805c72 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -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() |