summaryrefslogtreecommitdiff
path: root/tools/binman/main.py
Commit message (Collapse)AuthorAgeFilesLines
* patman: test_util: Use unittest text runner to print test resultsAlper Nebi Yasak2022-06-281-5/+3
| | | | | | | | | | | | | | | | | The python tools' test utilities handle printing test results, but the output is quite bare compared to an ordinary unittest run. Delegate printing the results to a unittest text runner, which gives us niceties like clear separation between each test's result and how long it took to run the test suite. Unfortunately it does not print info for skipped tests by default, but this can be handled later by a custom test result subclass. It also does not print the tool name; manually print a heading that includes the toolname so that the outputs of each tool's tests are distinguishable in the CI output. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* binman: don't import deprecated distutils packageHeinrich Schuchardt2022-04-251-7/+0
| | | | | | | | | | | | | | | | | | | 'make tests' fails on Ubuntu 22.04 with: binman: ./tools/binman/binman:12: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.sysconfig import get_python_lib ./tools/binman/binman:12: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead from distutils.sysconfig import get_python_lib <unittest.result.TestResult run=428 errors=0 failures=4> AssertionError: 0 != 468 As we don't use Ubuntu 16.04 for our CI anymore drop the import. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
* tools: binman: main.py: add build-sandbox in sys.pathPhilippe Reynes2022-03-181-0/+1
| | | | | | | | Adds build-sandbox in sys.path to look for libfdt, otherwise py_test can't use binman. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* patman: Convert camel case in test_util.pySimon Glass2022-02-091-3/+3
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add a command to generate bintool docsSimon Glass2022-01-251-0/+4
| | | | | | | Each bintool has some documentation which can be useful for the user. Add a new command that collects this and writes it into a .rst file. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Enable bintool tests including cmdline processingSimon Glass2022-01-251-3/+4
| | | | | | | The tests rely on having at least 5 bintool implementions. Now that we have this, enable them. Add tests for the binman 'tool' subcommand. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Use less hard coded magic when inserting new PATHAndy Shevchenko2021-12-171-5/+7
| | | | | | | | Instead of joining hard coded '..' to the run-time path of the executable, take just a dirname out of it. Besides that, use $(srctree) where it makes sense. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* binman: Do not pollute source tree when build with `make O=...`Andy Shevchenko2021-12-171-1/+12
| | | | | | | | | Importing libraries in Python caches the bytecode by default. Since we run scripts in source tree it ignores the current directory settings, which is $(srctree), and creates cache just in the middle of the source tree. Move cache to the current directory. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* binman: Add a utility module for ATF FIPSimon Glass2021-12-171-1/+3
| | | | | | | | | | | | | Add support for this format which is used by ARM Trusted Firmware to find firmware binaries to load. FIP is like a simpler version of FMAP but uses a UUID instead of a name, for each entry. It supports reading a FIP, writing a FIP and parsing the ATF source code to get a list of supported UUIDs. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Correct some import statementsSimon Glass2020-08-221-1/+0
| | | | | | | | | Some of these were not converted when binman moved to use absolute paths. Fix them. Also drop the import of 'test' which is a directory, not a module. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Move GetEntryModules() to controlSimon Glass2020-08-221-14/+2
| | | | | | | | | | | When binman is installed its main program is in a different directory to its modules. This means that __file__ is different and we cannot use it to obtain the path to etype/ from main.py To fix this, move the function to the 'control' module, since it is installed with all the other modules, including the etype/ directory. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Set a default toolpathSimon Glass2020-07-241-0/+5
| | | | | | | | | | | When binman is run from 'make check' it is given a toolpath so that the latest tools (e.g. mkimage) are used. When run manually with no toolpath, it relies on the system mkimage. But this may be missing or old. Make some effort to find the built-from-soruce version by looking in the current directory and in the builds created by 'make check'. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Specify the toolpath when running test coverageSimon Glass2020-07-241-3/+7
| | | | | | | | | | | At present binman's test coverage runs without a toolpath set. This means that the system tools will be used. That may not be correct if they are out of date or missing and this can result in a reduction in test coverage below 100%. Provide the toolpath to binman in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Correct the search patch for pylibfdtSimon Glass2020-07-241-0/+1
| | | | | | | | | Now that binman uses tools/ as its base directory for importing modules, the path to the pylibfdt build by U-Boot is incorrect. Fix it with a new path. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Output errors to stderrSimon Glass2020-07-241-1/+1
| | | | | | | | | At present binman outputs errors to stdout which means that fails are effectively silent when printed by buildman, for example. Fix this by outputing errors to stderr. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"Tom Rini2020-07-241-14/+4
| | | | | | | | | | This reverts commit 5d3a21df6694ebd66d5c34c9d62a26edc7456fc7, reversing changes made to 56d37f1c564107e27d873181d838571b7d7860e7. Unfortunately this is causing CI failures: https://travis-ci.org/github/trini/u-boot/jobs/711313649 Signed-off-by: Tom Rini <trini@konsulko.com>
* binman: Set a default toolpathSimon Glass2020-07-201-0/+5
| | | | | | | | | | | When binman is run from 'make check' it is given a toolpath so that the latest tools (e.g. mkimage) are used. When run manually with no toolpath, it relies on the system mkimage. But this may be missing or old. Make some effort to find the built-from-soruce version by looking in the current directory and in the builds created by 'make check'. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Specify the toolpath when running test coverageSimon Glass2020-07-201-3/+7
| | | | | | | | | | | At present binman's test coverage runs without a toolpath set. This means that the system tools will be used. That may not be correct if they are out of date or missing and this can result in a reduction in test coverage below 100%. Provide the toolpath to binman in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Correct the search patch for pylibfdtSimon Glass2020-07-201-0/+1
| | | | | | | | | Now that binman uses tools/ as its base directory for importing modules, the path to the pylibfdt build by U-Boot is incorrect. Fix it with a new path. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Output errors to stderrSimon Glass2020-07-201-1/+1
| | | | | | | | | At present binman outputs errors to stdout which means that fails are effectively silent when printed by buildman, for example. Fix this by outputing errors to stderr. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* patman: Tidy up sys.path changesSimon Glass2020-04-261-2/+3
| | | | | | | | | | | | Now that we are using absolute paths we can remove some of the sys.path mangling that appears in the tools. We only need to add the path to 'tools/' so that everything can find modules relative to that directory. The special paths for finding pylibfdt remain. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Move to absolute importsSimon Glass2020-04-261-1/+1
| | | | | | | | | | | At present patman sets the python path on startup so that it can access the libraries it needs. If we convert to use absolute imports this is not necessary. Move patman to use absolute imports. This requires changes in tools which use the patman libraries (which is most of them). Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Move to absolute importsSimon Glass2020-04-261-12/+11
| | | | | | | | | | | At present binman sets the python path on startup so that it can access the libraries it needs. If we convert to use absolute imports this is not necessary. Move binman to use absolute imports. This enables removable of the path adjusting in Entry also. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Move test running/reporting to test_utilSimon Glass2020-04-261-70/+8
| | | | | | | This code is useful in other tools. Move it into a common file so it can be shared. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Rename the main moduleSimon Glass2020-04-261-0/+200
Python does not like the module name being the same as the module directory. To allow buildman modules to be used from other tools, rename it. Signed-off-by: Simon Glass <sjg@chromium.org>