summaryrefslogtreecommitdiff
path: root/tools/u_boot_pylib/test_util.py
AgeCommit message (Collapse)Author
2025-05-27tools: Plumb in capture controlSimon Glass
Add control of capturing output into u_boot_pylib and the tools which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27u_boot_pylib: Avoid concurrent execution of only one testSimon Glass
There is no point in spinning up multiple processes if there is only one test to execute. Add a check for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Move capture_sys_output() into terminal and renameSimon Glass
This function is sometimes useful outside tests. Also it can affect how terminal output is done, e.g. whether ANSI characters should be emitted or not. Move it out of the test_util package and into terminal. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-24python: Use and refer to the venv module rather than virtualenvTom Rini
Using some form of sandbox with Python modules is a long standing best practice with the language. There are a number of ways to have a Python sandbox be created. At this point in time, it seems the Python community is moving towards using the "venv" module provided with Python rather than a separate tool. To match that we make the following changes: - Refer to a "Python sandbox" rather than virtualenv in comments, etc. - Install the python3-venv module in our container and not virtualenv. - In our CI files, invoke "python -m venv" rather than "virtualenv". - In documentation, tell users to install python3-venv and not virtualenv. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-04-11binman: Work around missing test coverageSimon Glass
The iMX8 entry-types don't have proper test coverage. Add a work-around to skip this for now. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-11binman: Exclude dist-packages and site-packagesSimon Glass
Newer versions of the python3-coverage tool require a directory separator before and after the directory name. Add this so that system package are not included in the coverage report. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-18u_boot_pylib: Support running coverage on selected functionsSimon Glass
At present run_test_coverage() assumes you want code coverage for the entire code base. This is the normal situation, but sometimes it is useful to see the coverage provided by just a single test. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-03u_boot_pylib: Use correct coverage tool within venvSimon Glass
When running within a Python venv we must use the 'coverage' tool (which is within the venv) so that the venv packages are used in preference to system packages. Otherwise the coverage tests run in a different environment from the normal tests and may fail due to missing packages. Handle this by detecting the venv and changing the tool name. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Enable test coverageSimon Glass
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>
2023-03-08patman: Move library functions into a library directorySimon Glass
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>