aboutsummaryrefslogtreecommitdiff
path: root/tools/buildman/test.py
Commit message (Collapse)AuthorAgeFilesLines
* buildman: Export _get_output_dir() to avoid warningsSimon Glass2023-07-241-1/+1
| | | | | | Make this a public memory since it is used outside the class. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert camel case in builder.pySimon Glass2023-07-241-11/+11
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert camel case in bsettings.pySimon Glass2023-07-241-2/+2
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert camel case in control.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>
* patman: Move library functions into a library directorySimon Glass2023-03-081-4/+4
| | | | | | | | | | | 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>
* buildman: Split out Boards into its own fileSimon Glass2022-08-051-1/+2
| | | | | | | | | | 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>
* buildman: Convert camel case in board.pySimon Glass2022-08-051-12/+12
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Fix use of 'boards' in testSimon Glass2022-08-051-21/+21
| | | | | | | | 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>
* buildman: Avoid using board as a variableSimon Glass2022-08-051-2/+2
| | | | | | | | | | 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>
* tools: buildman: Fix doc path in warning messageJohannes Krottmayer2022-03-201-1/+1
| | | | | | | | Fix documentation path in deprecated warning message about device driver. Signed-off-by: Johannes Krottmayer <krjdev@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* patman: Convert camel case in terminal.pySimon Glass2022-02-091-4/+4
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Rename Color() method to build()Simon Glass2022-02-091-10/+10
| | | | | | | | | This method has the same name as its class which is confusing. It is also annoying when searching the code. It builds a string with a colour, so rename it to build(). Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Convert camel case in tools.pySimon Glass2022-02-091-1/+1
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add helper functions for updating .config filesSimon Glass2022-02-081-0/+123
| | | | | | | | | | | | 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>
* buildman: Support single-threaded operationSimon Glass2021-03-041-3/+9
| | | | | | | | | | At present even if only a single thread is in use, buildman still uses threading. For some debugging it is helpful to do everything in the main process. Allow -T0 to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: Drop unnecessary use of __file__Simon Glass2020-09-221-3/+0
| | | | | | | There are few places where the path of the current modules is calculated but not used. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Correct the testOutputDir() unit testSimon Glass2020-07-281-2/+1
| | | | | | | This current fails with an error. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 7664b03ffc5 ("buildman: Remove _of_#_ from results directory paths")
* buildman: Remove _of_#_ from results directory pathsOvidiu Panait2020-06-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Currently, the following scenario will rebuild the first commit even though it is not really necessary - the commit sha or the position in the patchset did not change: $ git am <local-patch-0001> $ tools/buildman/buildman -P -E -W -b master mx6 <do some more development work> $ git am <local-patch-0002> $ tools/buildman/buildman -P -E -W -b master mx6 <- will rebuild the first commit as well, even though nothing has changed about it. This is due to the fact that previous results directories get removed when the number of commits change. By removing the _of_#_ part of the directory path, the commits will be rebuilt only if the commit sha or the position in the patchset changes. Also, update the testcase to reflect this change. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
* patman: Tidy up sys.path changesSimon Glass2020-04-261-1/+0
| | | | | | | | | | | | 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-5/+5
| | | | | | | | | | | 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-6/+6
| | | | | | | | | | | 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: Fix test for new 9.2 kernelSimon Glass2020-04-261-1/+1
| | | | | | | The naming is slightly different on kernel.org now. Update the regex so that the test still passes. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add an option to ignore migration warningsSimon Glass2020-04-211-31/+89
| | | | | | | | | | These are becoming more common now. They cause boards to show warnings which can be mistaking for compiler warnings. Add a buildman option to ignore them. This option works only with the summary option (-s). It does not affect the build process. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add an option to ignore device-tree warningsSimon Glass2020-04-211-7/+24
| | | | | | | | | | Unfortunately the plague of device-tree warnings has not lifted. These warnings infiltrate almost every build, adding noise and confusion. Add a buildman option to ignore them. This option works only with the summary option (-s). It does not affect the build process. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Show a summary of the build resultSimon Glass2020-04-211-3/+3
| | | | | | | | | | | When buildman finishes it leaves the last summary line visible, which shows the number of successful builds, builds with warnings and builds with errors. It is useful also to see how many builds were done in total along with the time taken. Show these on a separate line before buildman finishes. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Use spaces in the board listSimon Glass2020-04-211-3/+3
| | | | | | | | | | | | At present the board names shown with -l are separated by commas. This makes it hard to double-click to select a particular board. Also it is not possible to select all boards and paste them as arguments to a subsequent buildman run, since buildman requires spaces to separate the list on the command line, not commas. Change the output format to use spaces instead of commas. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Show the list of boards in magentaSimon Glass2020-04-211-37/+33
| | | | | | | | | | | It is quite hard to see the list of board for each error line since the colour is the same as the actual error line. Show the board list in magenta so that it is easier to distinguish them. There is no point in checking the colour of the overall line, since there are now multiple colours. So drop those tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Use yellow consistently for warning linesSimon Glass2020-04-211-3/+3
| | | | | | | At present warnings are shown in yellow in the summary (-s) but magenta in the detail listing (-e). Use yellow in both. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Test the output with --list-error-boardsSimon Glass2020-04-211-14/+32
| | | | | | | Add a test to cover this flag, which adds the name of each board to each error/warning line. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add a test helper for creating a line prefixSimon Glass2020-04-211-20/+31
| | | | | | | The split/join code is repeated in a lot of places. Add a function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Split out testOutput() into separate functionsSimon Glass2020-04-211-6/+28
| | | | | | | | We want to add a few more tests similar to testOutput(). Split its logic into a function which runs buildman to get the output and another which checks the output. This will make it easier to reuse the code. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Create temp directory in test setupSimon Glass2020-04-211-16/+10
| | | | | | | | | | | Rather than having a few tests handle this themselves, create the temporary directory in the setUp() method and remove it in tearDown(). This will make it easier to add more tests. Only testOutput and testGit() actually need it, but it doesn't add to the test time noticeably to do this for all tests in this file. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Use an iterator to check test outputSimon Glass2020-04-211-42/+52
| | | | | | | Rather than using the absolute array index, use an interator to work through the expected output lines. This is easier to follow. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add test coverage for error/warning colourSimon Glass2020-04-211-0/+7
| | | | | | | Buildman should output the right colours for each error/warning line. Some of these checks are missing. Add them. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Be more selective about which directories to removeSimon Glass2020-04-101-0/+20
| | | | | | | | | | | | | | | | | | | At present buildman removes any directory it doesn't intend to write output into. This is overly expansive since if the output directory happens to be somewhere with existing files, they may be removed. Using an existing directory for buildman is not a good practice, but since the result might be catastrophic, it is best to guard against it. A previous commit[1] fixed this by refusing to write to a subdirectory of the current directory, assumed to have U-Boot source code. But we can do better by only removing directories that look like the ones buildman creates. Update the code to do this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org> [1] 409fc029c40 tools: buildman: Don't use the working dir as build dir
* buildman: Add options to get the arch and toolchain infoSimon Glass2019-12-101-0/+18
| | | | | | | | | Sometimes it is useful for external tools to use buildman to provide the toolchain information. Add an -a option which shows the value to use for the ARCH environment variable, and -A which does the same for CROSS_COMPILE Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert to Python 3Simon Glass2019-11-041-11/+11
| | | | | | | Convert buildman to Python 3 and make it use that, to meet the 2020 deadline. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: buildman: Remove useless mkdir() in Make() in test.pyBin Meng2019-10-291-8/+0
| | | | | | | | | In the 'Make' function, the codes tries to create a directory if current stage is 'build'. But the directory isn't used at all anywhere. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* buildman: Show boards with warning with w+Simon Glass2018-11-201-15/+41
| | | | | | | | At present we should boards with warnings in the same way as those with errors. This is not ideal. Add a new 'warn' state and show these listed in yellow to match the actual warning lines printing with -e. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Detect dtc warningsSimon Glass2018-11-201-2/+3
| | | | | | | | | | | | | At present messages from the device-tree compiler like this: arch/arm/dts/socfpga_arria10_socdk_sdmmc.dtb: Warning (avoid_unnecessary_addr_size): /clocks: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property are detected as errors since they don't match the gcc warning regex. Add a new one for dtc to fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add a --boards option to specify particular boards to buildSimon Glass2018-11-141-14/+17
| | | | | | | | | | | At present 'buildman sandbox' will build all 5 boards for the sandbox architecture rather than the single board 'sandbox'. The only current way to exclude sandbox_spl, sandbox_noblk, etc. is to use -x which is a bit clumbsy. Add a --boards option to allow individual build targets to be specified. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: dtoc: Suppress unwanted output from testSimon Glass2018-10-081-1/+3
| | | | | | | There are a few test cases which print output. Suppress this so that tests can run silently in the normal case. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Make the toolchain test more forgivingSimon Glass2018-10-081-2/+4
| | | | | | | | The filenames of the toolchains on kernel.org changes every now and then. Fix it for the current change, and make the test use a regex so that it has a better chance of passing with future changes too. Signed-off-by: Simon Glass <sjg@chromium.org>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-071-3/+1
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* buildman: Fix up testsSimon Glass2017-11-221-10/+21
| | | | | | | | | | | The tests were broken by two separate commits which adjusted the output when boards are listed. Fix this by adding back a PowerPC board and putting the name of each board in the test. Fixes: b9f7d881 (powerpc, 5xx: remove some "5xx" remains) Fixes: 8d7523c5 (buildman: Allow showing the list of boards with -n) Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Allow skipping of tests which use the networkSimon Glass2017-11-221-2/+5
| | | | | | | Accessing the network slows down the test and limits the environment in which it can be run. Add an option to disable network tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* powerpc, 5xx: remove some "5xx" remainsHeiko Schocher2017-06-161-1/+0
| | | | | | we removed 5xx support. So delete some forgotten remains. Signed-off-by: Heiko Schocher <hs@denx.de>
* buildman: Print a message indicating the build is startingSimon Glass2016-10-091-2/+2
| | | | | | | Make it clear when buildman actually starts building. This happens when it has prepared the threads, working directory and output directories. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add gcc 4.9.0 with Microblaze toolchainMichal Simek2015-04-231-1/+1
| | | | | | | | | | | Also read gcc 4.9.0 at kernel.org which also have Microblaze toolchain. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Fixed unit test failure by updating the test: Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Add a space before the list of boardsSimon Glass2015-03-051-1/+1
| | | | | | | | | | Tweak the output slightly so we don't get things like: - board1 board2+ board3 board4 There should be a space before the '+'. Signed-off-by: Simon Glass <sjg@chromium.org>