summaryrefslogtreecommitdiff
path: root/tools/buildman/func_test.py
AgeCommit message (Collapse)Author
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-05-27buildman: Add a way to build a particular targetSimon Glass
At present buildman only supports building the default target. Generally this is what is wanted, but in some cases boards erroneously have a different target for product extra files. Add a --target option to help. Also add a comment indicating which letters are free for new options. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-01u_boot_pylib: Clean up pylint warnings in gitutil.pySimon Glass
This file has about 40 pylint warnings, but no errors. Quite a few of these warnings have been there for a while, but most are coming from newer versions of pylint, where people come up with new warnings. The f-string warning is the most common one: C0209: Formatting a regular string which could be an f-string That feature was not available when the code was written, but it is often more convenient than using % with a list of arguments. This patches reduces the number of warnings in this file, with 7 left remaining. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-04Merge patch series "tools: Minor clean-ups for the command library"Tom Rini
Simon Glass <sjg@chromium.org> says: This series adds comments and fixes pylint warnings in the command library. It also introduces a new, simpler way of running a single command. Link: https://lore.kernel.org/r/20250203162704.627469-1-sjg@chromium.org
2025-03-04u_boot_pylib: Add a function to run a single commandSimon Glass
Add a helper to avoid needing to use a list within a list for this simple case. Update existing users of runpipe() to use this where possible. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-04u_boot_pylib: Correct case for test_resultSimon Glass
This should be in capitals and defined at the start of the file. Update it. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-17u_boot_pylib: Move gitutil into the librarySimon Glass
Move this file into U-Boot's Python library, so that it is no-longer part of patman. This makes a start on: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35 Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-19buildman: Support #include files in defconfigsSimon Glass
This is used by some boards in U-Boot and is a convenient way to deal with common settings where using a Kconfig files is not desirable. Detect #include files and process them as if they were part of the original file. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/30
2024-11-19buildman: Add a lower-level test for KconfigScannerSimon Glass
This code is tested by test_scan_defconfigs() but it is useful to have some specific tests for the KconfigScanner's operation in U-Boot. Add a test which checks that the values are obtained correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-03tools: binman: fix deprecated Python unittest methodsBrandon Maier
The methods `unittest.assertEquals()` and `unittest.assertRegexpMatches()` are marked deprecated[1]. In Python 3.12 these aliases have been removed, so do a sed to replace them with their new names. [1] https://docs.python.org/3.11/library/unittest.html#deprecated-aliases Signed-off-by: Brandon Maier <brandon.maier@collins.com> CC: Simon Glass <sjg@chromium.org> CC: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
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>