summaryrefslogtreecommitdiff
path: root/tools/buildman/func_test.py
AgeCommit message (Collapse)Author
2023-11-07buildman: Use oldconfig when adjusting the configSimon Glass
We cannot be sure that the new config is consistent, particularly when changing a major item like CONFIG_CMDLINE. Use 'make oldconfig' to check that and avoid any such problems. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-05buildman: Drop warning about orphaned defconfigsSimon Glass
Some boards use a MAINTAINERS entry to specify common files without referencing any defconfigs. This is allowed and should not result in a warning. Drop the warning in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-25buildman: Specify the output directory in testsSimon Glass
The default output directory is generally '../' in tests so we end up trying to create '../.bm-work'. This does not work with azure, so update these tests to use the temporary directory instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a way to print the architecture for a boardSimon Glass
This is useful for some tools and is easily available for buildman. Add a new --print-arch option. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Tidy up reporting of a toolchain errorSimon Glass
Provide the text of the exception when something goes wrong. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert camel case in builder.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert camel case in bsettings.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert to argparseSimon Glass
Use argparse to parse the arguments, since OptionParser is deprecated now. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a test for --boardsSimon Glass
Add a simple functional test for the --boards option. Fix the example in the docs while we are here. Also improve the docs for Builder.count so it is clearer what it contains. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert camel case in cmdline.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add tests for excluding thingsSimon Glass
Add some tests for the -x flag. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a test for the -A optionSimon Glass
This lacks a test at present. Add one. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Fix most pylint warnings in controlSimon Glass
Tidy up the easier-to-fix pylint warnings in module 'control'. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert camel case in control.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Provide an argument to the -R optionSimon Glass
Allow writing the file to a selected location, since otherwise this is controlled by the buildman configuration, so cannot be determined by the caller. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: https://source.denx.de/u-boot/u-boot/-/issues/17
2023-07-24buildman: Add an option to check maintainersSimon Glass
Rather than using the -R option to get this report as a side effect, add a dedicated option for it. Disable CI for now as there are some missing maintainers, unfortunately. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Correct logic for missing maintainersSimon Glass
An orphaned board should produce a warning, as should a missing name for the maintainer (when '-' is provided). Add these cases. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Sort the maintainer warningsSimon Glass
Sort the warnings into alphabetical order, for easier reading. Also make sure that the buildman test files are ignored. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Just display a single line for missing maintainersSimon Glass
At present we get multiple lines of output when a board has no MAINTAINERS entry: WARNING: no status info for 'bananapi-m2-pro' WARNING: no maintainers for 'bananapi-m2-pro' Suppress the 'status' one since it is implied by the other. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Correct operation of MAINTAINERS N:Simon Glass
This doesn't work as intended. Instead it scans every defconfig file in the source tree. Fix it and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Detect boards with no CONFIG_TARGET definedSimon Glass
We generally expected exactly one of these. Add a check for it. Note: This warning is not displayed by default. An option will be added to enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Detect boards with multiple CONFIG_TARGETs definedSimon Glass
The TARGET_xxx options are special in that they refer to a single target. Exactly one should be enabled for each target, corresponding to a defconfig file. Detect configs which result in two TARGET_xxx options being set. For example, at present, TARGET_POLEG and TARET_POLEG_EVB are enabled for the same board. Note: This warning is not displayed by default. An option will be added to enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Warn about dangling maintainer entriesSimon Glass
Other than the top-level MAINTAINERS file, all maintainer entries should actually reference a target. Add a warning to detect those that do not. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a partial test for ensure_board_list()Simon Glass
Create a new function which has the non-UI parts of ensure_board_list(). Add some tests for everything except the N: tag. While we are here, fix the confusing usage of fname inside a loops that also uses fname. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a test for Boards.output_is_new()Simon Glass
Add a test for this code, adjusting the timestamp on various files to check each use case. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a test for Boards.scan_defconfigs()Simon Glass
Add a test for this code. It requires some defconfig files and a test Kconfig to work with, so copy these into the temporary directory at the start. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Rename the ARM boardsSimon Glass
Use names consistent with their target names. 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>
2023-03-08buildman: Add a flag for reproducible buildsSimon Glass
This is quite a useful thing to use when building since it avoids small size changes between commits. Add a -r flag for it. Also undefine CONFIG_LOCALVERSION_AUTO since this appends the git hash to the version string, causing every build to be slightly different. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08buildman: Support disabling LTOSimon Glass
This cuts down build performance considerably and is not always needed, when checking for build errors, etc. Add a flag to disable it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08buildman: Write out the build command usedSimon Glass
It is sometimes useful to see the exact 'make' command used by buildman for a commit. Add an output file for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-22buildman: Add --allow-missing flag to allow missing blobsTom Rini
Add a new flag to buildman so that we will in turn pass BINMAN_ALLOW_MISSING=1 to 'make'. Make use of this flag in CI. Allow the settings file to control this. Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2022-11-22buildman: Reinstate removal of temp output dir in testsSimon Glass
This was dropped my mistake. Reinstate it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: d829f1217c6 ("bulidman: Add support for a simple build")
2022-11-22buildman: Convert documentation to rSTSimon Glass
Convert the buildman documentation to rST format and include it in the 'build' section. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Quentin Schulz <foss+uboot@0leil.net>
2022-08-05buildman: Split out Boards into its own fileSimon Glass
Use a separate file for the Boards class so that its name matches the module name. Fix up the function names to match the pylint style and fix some other warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Convert camel case in board.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Drop use of 'boards' in controlSimon Glass
Use brds instead so that we can reserve 'boards' for a module name. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Fix use of 'boards' in func_testSimon Glass
We want to create a module called 'boards' so avoid use of this variable name in this module. Change the global to be capitalised, as required by Python style. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Avoid using board as a variableSimon Glass
We have a module called 'board'. Sometimes buildman uses 'brd' as an instance variable but sometimes it uses 'board', which is confusing and can mess with the module handling. Update the code to use 'brd' consistently, making it easier for tools to determine when the module is being referenced. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-02buildman: Correct pylint errorsSimon Glass
Fix pylint errors that can be fixed and mask those that seem to be incorrect. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in terminal.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in gitutil.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in command.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in tools.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-08buildman: Provide a hint on how to debug thread crashesSimon Glass
If a thread crashes it is helpful to try the operation again with threading disabled. Add a hint about that. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-08buildman: Add helper functions for updating .config filesSimon Glass
At present the only straightforward way to write tests that need a slightly different configuration is to create a new board with its own configuration. This is cumbersome. It would be useful if buildman could adjust the configuration of a build on the fly. In preparation for this, add a utility library which can modify a .config file according to various parameters passed to it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-29buildman: Use bytes for the environmentSimon Glass
At present we sometimes see problems in gitlab where the environment has 0x80 characters or sequences which are not valid UTF-8. Avoid this by using bytes for the environment, both internal to buildman and when writing out the 'env' file. Add a test to make sure this works as expected. Reported-by: Marek Vasut <marex@denx.de> Fixes: e5fc79ea718 ("buildman: Write the environment out to an 'env' file") Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-29buildman: Handle exceptions in threads gracefullySimon Glass
There have been at least a few cases where an exception has occurred in a thread and resulted in buildman hanging: running out of disk space and getting a unicode error. Handle these by collecting a list of exceptions, printing them out and reporting failure if any are found. Add a test for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-29buildman: Tidy up a few commentsSimon Glass
Add some function comments which are missing, or missing arguments. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-09-22buildman: Use git worktrees instead of git clones when possibleAlper Nebi Yasak
This patch makes buildman create linked working trees instead of clones of the source repository, but keeps updating the older clones of the repository that might already exist. These worktrees share "everything except working directory specific files such as HEAD, index, etc." with the source repository. See the git-worktree(1) manual page for more information. If git-worktree isn't available, silently falls back to cloning the repository. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>