aboutsummaryrefslogtreecommitdiff
path: root/tools/buildman/main.py
Commit message (Collapse)AuthorAgeFilesLines
* buildman: Fix full help for Python 3.8Simon Glass2023-09-231-2/+8
| | | | | | | | | | With Python versions older than 3.9 Buildman produces an error on start-up. Fix this with a workaround for importlib. There is already a workaround for v3.6 but I am not sure if that is still functioning. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Enable test coverageSimon Glass2023-07-241-1/+14
| | | | | | | Enable measuring test coverage for buildman so we can see the gaps. It is currently at 68%. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert camel case in bsettings.pySimon Glass2023-07-241-1/+1
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert to argparseSimon Glass2023-07-241-9/+8
| | | | | | Use argparse to parse the arguments, since OptionParser is deprecated now. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert camel case in cmdline.pySimon Glass2023-07-241-1/+1
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Move full-help processing to mainSimon Glass2023-07-241-0/+9
| | | | | | | | | | This does not need any of the control features. Move it out of main to reduce the size of the do_buildman() function. For Python 3.6 the -H feature will not work, but this does not seem to be a huge problem, as it dates from 2016. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert camel case in control.pySimon Glass2023-07-241-2/+1
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Tidy up pylint warnings in mainSimon Glass2023-07-241-13/+12
| | | | | | Tidy up the various pylint warnings in module 'main'. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Exit with the return code consistentlySimon Glass2023-07-241-3/+5
| | | | | | | Test should return a suitable exit code when they fail. Fix this and tidy up the code a little. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Allow --debug to enable debuggingSimon Glass2023-07-241-3/+4
| | | | | | | The -D option is used, but plumb it through --debug to enable a full traceback when something goes wrong. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Fix verboose typo and add commentSimon Glass2023-07-241-2/+9
| | | | | | | Fix the typo in the RunTests() function, adding comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Move the main code into a functionSimon Glass2023-03-081-11/+16
| | | | | | Put this code into a function so it is easy for it be run when packaged. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Move library functions into a library directorySimon Glass2023-03-081-2/+2
| | | | | | | | | | | The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
* 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>
* buildman: Correct pylint errorsSimon Glass2022-03-021-2/+2
| | | | | | | Fix pylint errors that can be fixed and mask those that seem to be incorrect. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Convert camel case in test_util.pySimon Glass2022-02-091-2/+2
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Make use of test_utilSimon Glass2022-02-081-15/+11
| | | | | | | Use test_util to run the tests, with the ability to select a single test to run, if desired. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add a flag to control the tracebackSimon Glass2022-02-081-0/+3
| | | | | | | | At present the full horror of the Python traceback is shown by default. It is normally only useful for debugging. Turn it off by default and add a --debug flag to enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Tidy up sys.path changesSimon Glass2020-04-261-2/+1
| | | | | | | | | | | | 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-3/+3
| | | | | | | | | | | 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>
* buildman: Move to absolute importsSimon Glass2020-04-261-10/+10
| | | | | | | | | | | At present buildman 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 buildman to use absolute imports. Also adjust moveconfig.py too since it uses some buildman modules and cannot work without this. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Rename the main moduleSimon Glass2020-04-261-0/+66
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>