diff options
author | Simon Glass <sjg@chromium.org> | 2018-07-06 10:27:20 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-07-09 09:11:00 -0600 |
commit | 3def0cf238e0df9736a4ce8fb54c1eb561a56ddd (patch) | |
tree | 6c09c604e0e82f51a05b111087c6bd7d4bda49de /tools/dtoc/dtoc.py | |
parent | 5c890238c480a96d4d0b06c92199e21867170c31 (diff) |
libfdt: Bring in proposed pylibfdt changes
This provides various patches sent to the devicetree-compiler mailing list
to enhance the Python bindings. A final version of this patch may be
created once upstreaming is complete, but if it takes too long, this can
act as a placeholder.
New pylibfdt features:
- Support for most remaining, relevant libfdt functions
- Support for sequential-write functions
Changes are applied to existing U-Boot tools as needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/dtoc.py')
-rwxr-xr-x | tools/dtoc/dtoc.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/dtoc/dtoc.py b/tools/dtoc/dtoc.py index 008c0f4d69..c891b06380 100755 --- a/tools/dtoc/dtoc.py +++ b/tools/dtoc/dtoc.py @@ -36,14 +36,26 @@ sys.path.append(os.path.join(our_path, '../patman')) import dtb_platdata -def run_tests(): - """Run all the test we have for dtoc""" +def run_tests(args): + """Run all the test we have for dtoc + + Args: + args: List of positional args provided to binman. This can hold a test + name to execute (as in 'binman -t testSections', for example) + """ import test_dtoc result = unittest.TestResult() sys.argv = [sys.argv[0]] + test_name = args and args[0] or None for module in (test_dtoc.TestDtoc,): - suite = unittest.TestLoader().loadTestsFromTestCase(module) + if test_name: + try: + suite = unittest.TestLoader().loadTestsFromName(test_name, module) + except AttributeError: + continue + else: + suite = unittest.TestLoader().loadTestsFromTestCase(module) suite.run(result) print result @@ -68,7 +80,7 @@ parser.add_option('-t', '--test', action='store_true', dest='test', # Run our meagre tests if options.test: - run_tests() + run_tests(args) else: dtb_platdata.run_steps(args, options.dtb_file, options.include_disabled, |