buildman: Adjust tests for new boards.cfg format
PATCH v2 1/2 buildman: Adjust tests for new boards.cfg format
Commit 27af930e9a5c91365ca639ada580b338eabe4989 changed the boards.cfg format but missed to change the parsing in buildman. A follow-on commit 03c1bb242548e4e9d267d784861ccd69a1887aa0 fixed this but missed fixing the tests.
This patch updates the tests to fit the new Board constructor.
./tools/buildman/buildman -t <unittest.result.TestResult run=1 errors=0 failures=0>
---
Changes in v2: None
tools/buildman/test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tools/buildman/test.py +5 -5
@@ -60,11 +60,11 @@ commits = [ ] boards = [ - ['board0', 'arm', 'armv7', 'ARM Board 1', 'Tester', '', ''], - ['board1', 'arm', 'armv7', 'ARM Board 2', 'Tester', '', ''], - ['board2', 'powerpc', 'powerpc', 'PowerPC board 1', 'Tester', '', ''], - ['board3', 'powerpc', 'mpc5xx', 'PowerPC board 2', 'Tester', '', ''], - ['board4', 'sandbox', 'sandbox', 'Sandbox board', 'Tester', '', ''] + ['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 1', 'board0', ''], + ['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 2', 'board1', ''], + ['Active', 'powerpc', 'powerpc', '', 'Tester', 'PowerPC board 1', 'board2', ''], + ['Active', 'powerpc', 'mpc5xx', '', 'Tester', 'PowerPC board 2', 'board3', ''], + ['Active', 'sandbox', 'sandbox', '', 'Tester', 'Sandbox board', 'board4', ''], ] class Options:
Signature · 1 line
1.8.4
PATCH v2 2/2 buildman: Allow make flags to be specified for each board
There are a few make options such as BUILD_TAG which can be provided when building U-Boot. Provide a way for buildman to pass these flags to make also.
The flags should be in a [make-flags] section and arranged by target name (the 'target' column in boards.cfg. See the README for more details.
---
Changes in v2:
Correct unit test invocation
tools/buildman/README | 22 ++++++++++++ tools/buildman/bsettings.py | 3 -- tools/buildman/builder.py | 1 + tools/buildman/buildman.py | 13 ++++++++ tools/buildman/toolchain.py | 81 +++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 115 insertions(+), 5 deletions(-)
tools/buildman/README +22 -0
@@ -629,6 +629,28 @@ It is common when refactoring code for the rodata to decrease as the text size increases, and vice versa. +Providing 'make' flags +====================== + +U-Boot's build system supports a few flags (such as BUILD_TAG) which affect +the build product. These flags can be specified in the buildman settings +file. They can also be useful when building U-Boot against other open source +software. + +[make-flags] +at91-boards=ENABLE_AT91_TEST=1 +snapper9260=${at91-boards} BUILD_TAG=442 +snapper9g45=${at91-boards} BUILD_TAG=443 + +This will use 'make ENABLE_AT91_TEST=1 BUILD_TAG=442' for snapper9260 +and 'make ENABLE_AT91_TEST=1 BUILD_TAG=442' for snapper9g45. A special +variable ${target} is available to access the target name (snapper9260 and +snapper9g20 in this case). Variables are resolved recursively. + +It is expected that any variables added are dealt with in U-Boot's +config.mk file and documented in the README. + + Other options =============
tools/buildman/bsettings.py +0 -3
@@ -36,9 +36,6 @@ def GetItems(section): return settings.items(section) except ConfigParser.NoSectionError as e: print e - print ("Warning: No tool chains - please add a [toolchain] section " - "to your buildman config file %s. See README for details" % - config_fname) return [] except: raise
tools/buildman/builder.py +1 -0
@@ -253,6 +253,7 @@ class BuilderThread(threading.Thread): args.extend(['-j', str(self.builder.num_jobs)]) config_args = ['%s_config' % brd.target] config_out = '' + args.extend(self.builder.toolchains.GetMakeArguments(brd)) # If we need to reconfigure, do that now if do_config:
tools/buildman/buildman.py +13 -0
@@ -32,6 +32,19 @@ import toolchain def RunTests(): import test + import doctest + + result = unittest.TestResult() + for module in ['toolchain']: + suite = doctest.DocTestSuite(module) + suite.run(result) + + # TODO: Surely we can just 'print' result? + print result + for test, err in result.errors: + print err + for test, err in result.failures: + print err sys.argv = [sys.argv[0]] suite = unittest.TestLoader().loadTestsFromTestCase(test.TestBuild)
tools/buildman/toolchain.py +79 -2
100 lines not on this page · raw message
Signature · 1 line
1.8.4