Development mbed library for MAX32630FTHR

Dependents:   blinky_max32630fthr

Committer:
switches
Date:
Fri Nov 11 20:59:50 2016 +0000
Revision:
0:5c4d7b2438d3
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
switches 0:5c4d7b2438d3 1 # -*- python -*-
switches 0:5c4d7b2438d3 2 # ex: set syntax=python:
switches 0:5c4d7b2438d3 3
switches 0:5c4d7b2438d3 4 # This is a sample buildmaster config file. It must be installed as
switches 0:5c4d7b2438d3 5 # 'master.cfg' in your buildmaster's base directory.
switches 0:5c4d7b2438d3 6
switches 0:5c4d7b2438d3 7 # This is the dictionary that the buildmaster pays attention to. We also use
switches 0:5c4d7b2438d3 8 # a shorter alias to save typing.
switches 0:5c4d7b2438d3 9 c = BuildmasterConfig = {}
switches 0:5c4d7b2438d3 10
switches 0:5c4d7b2438d3 11 ####### BUILDSLAVES
switches 0:5c4d7b2438d3 12
switches 0:5c4d7b2438d3 13 # The 'slaves' list defines the set of recognized buildslaves. Each element is
switches 0:5c4d7b2438d3 14 # a BuildSlave object, specifying a unique slave name and password. The same
switches 0:5c4d7b2438d3 15 # slave name and password must be configured on the slave.
switches 0:5c4d7b2438d3 16 from buildbot.buildslave import BuildSlave
switches 0:5c4d7b2438d3 17 c['slaves'] = [BuildSlave("example-slave", "pass"),
switches 0:5c4d7b2438d3 18 BuildSlave("example-slave-2", "pass"),
switches 0:5c4d7b2438d3 19 BuildSlave("example-slave-KL25Z", "pass"),
switches 0:5c4d7b2438d3 20 BuildSlave("example-slave-LPC1768", "pass"),
switches 0:5c4d7b2438d3 21 BuildSlave("example-slave-LPC11U24", "pass"),
switches 0:5c4d7b2438d3 22 ]
switches 0:5c4d7b2438d3 23
switches 0:5c4d7b2438d3 24 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
switches 0:5c4d7b2438d3 25 # This must match the value configured into the buildslaves (with their
switches 0:5c4d7b2438d3 26 # --master option)
switches 0:5c4d7b2438d3 27 c['slavePortnum'] = 9989
switches 0:5c4d7b2438d3 28
switches 0:5c4d7b2438d3 29 ####### OFFICIAL_MBED_LIBRARY_BUILD
switches 0:5c4d7b2438d3 30
switches 0:5c4d7b2438d3 31 OFFICIAL_MBED_LIBRARY_BUILD = (
switches 0:5c4d7b2438d3 32 ('LPC1768', ('ARM', 'GCC_ARM', 'GCC_CR', 'IAR')),
switches 0:5c4d7b2438d3 33 ('KL05Z', ('ARM', 'uARM', 'GCC_ARM')),
switches 0:5c4d7b2438d3 34 ('KL25Z', ('ARM', 'GCC_ARM')),
switches 0:5c4d7b2438d3 35 ('LPC11U24', ('ARM', 'uARM')),
switches 0:5c4d7b2438d3 36 ('KL46Z', ('ARM', 'GCC_ARM')),
switches 0:5c4d7b2438d3 37 ('LPC4088', ('ARM', 'GCC_ARM', 'GCC_CR')),
switches 0:5c4d7b2438d3 38 ('LPC1347', ('ARM',)),
switches 0:5c4d7b2438d3 39 ('LPC1549', ('uARM',)),
switches 0:5c4d7b2438d3 40 ('LPC2368', ('ARM',)),
switches 0:5c4d7b2438d3 41 ('LPC812', ('uARM',)),
switches 0:5c4d7b2438d3 42 ('LPC11U35_401', ('ARM', 'uARM')),
switches 0:5c4d7b2438d3 43 ('LPC1114', ('uARM',)),
switches 0:5c4d7b2438d3 44 ('NUCLEO_F103RB', ('ARM', 'uARM')),
switches 0:5c4d7b2438d3 45 ('NUCLEO_L152RE', ('ARM', 'uARM')),
switches 0:5c4d7b2438d3 46 ('NUCLEO_F401RE', ('ARM', 'uARM')),
switches 0:5c4d7b2438d3 47 ('NUCLEO_F030R8', ('ARM', 'uARM')),
switches 0:5c4d7b2438d3 48 ('UBLOX_C027', ('ARM', 'GCC_ARM', 'GCC_CR', 'IAR')),
switches 0:5c4d7b2438d3 49 # ('NRF51822', ('ARM',)),
switches 0:5c4d7b2438d3 50 )
switches 0:5c4d7b2438d3 51
switches 0:5c4d7b2438d3 52 # Which hardware platforms are supported for target testing
switches 0:5c4d7b2438d3 53 OFFICIAL_MBED_TESTBED_SUPPORTED_HARDWARE = (
switches 0:5c4d7b2438d3 54 # 'KL25Z',
switches 0:5c4d7b2438d3 55 # 'LPC1768',
switches 0:5c4d7b2438d3 56 # 'LPC11U24',
switches 0:5c4d7b2438d3 57 )
switches 0:5c4d7b2438d3 58
switches 0:5c4d7b2438d3 59 ####### CHANGESOURCES
switches 0:5c4d7b2438d3 60
switches 0:5c4d7b2438d3 61 # the 'change_source' setting tells the buildmaster how it should find out
switches 0:5c4d7b2438d3 62 # about source code changes. Here we point to the buildbot clone of pyflakes.
switches 0:5c4d7b2438d3 63
switches 0:5c4d7b2438d3 64 from buildbot.changes.gitpoller import GitPoller
switches 0:5c4d7b2438d3 65 c['change_source'] = []
switches 0:5c4d7b2438d3 66 """
switches 0:5c4d7b2438d3 67 c['change_source'].append(GitPoller(
switches 0:5c4d7b2438d3 68 'git://github.com/buildbot/pyflakes.git',
switches 0:5c4d7b2438d3 69 workdir='gitpoller-workdir', branch='master',
switches 0:5c4d7b2438d3 70 pollinterval=300))
switches 0:5c4d7b2438d3 71 """
switches 0:5c4d7b2438d3 72 ####### SCHEDULERS
switches 0:5c4d7b2438d3 73
switches 0:5c4d7b2438d3 74 # Configure the Schedulers, which decide how to react to incoming changes. In this
switches 0:5c4d7b2438d3 75 # case, just kick off a 'runtests' build
switches 0:5c4d7b2438d3 76
switches 0:5c4d7b2438d3 77 from buildbot.schedulers.basic import SingleBranchScheduler
switches 0:5c4d7b2438d3 78 from buildbot.schedulers.forcesched import ForceScheduler
switches 0:5c4d7b2438d3 79 from buildbot.changes import filter
switches 0:5c4d7b2438d3 80 c['schedulers'] = []
switches 0:5c4d7b2438d3 81
switches 0:5c4d7b2438d3 82 # Create builders to generate one target using all assigned toolchains
switches 0:5c4d7b2438d3 83 release_builder_name = "BuildRelease"
switches 0:5c4d7b2438d3 84 builder_names = [release_builder_name]
switches 0:5c4d7b2438d3 85 for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
switches 0:5c4d7b2438d3 86 builder_name = "All_TC_%s" % target_name
switches 0:5c4d7b2438d3 87 builder_names.append(builder_name)
switches 0:5c4d7b2438d3 88 c['schedulers'].append(ForceScheduler(name="force", builderNames=builder_names))
switches 0:5c4d7b2438d3 89
switches 0:5c4d7b2438d3 90 ####### BUILDERS
switches 0:5c4d7b2438d3 91
switches 0:5c4d7b2438d3 92 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
switches 0:5c4d7b2438d3 93 # what steps, and which slaves can execute them. Note that any particular build will
switches 0:5c4d7b2438d3 94 # only take place on one slave.
switches 0:5c4d7b2438d3 95
switches 0:5c4d7b2438d3 96 from buildbot.process.factory import BuildFactory
switches 0:5c4d7b2438d3 97 from buildbot.steps.source.git import Git
switches 0:5c4d7b2438d3 98 from buildbot.steps.shell import ShellCommand
switches 0:5c4d7b2438d3 99 from buildbot.process.buildstep import LogLineObserver
switches 0:5c4d7b2438d3 100 import buildbot.status.results
switches 0:5c4d7b2438d3 101 import re
switches 0:5c4d7b2438d3 102 import pprint
switches 0:5c4d7b2438d3 103
switches 0:5c4d7b2438d3 104 class TestCommand(ShellCommand):
switches 0:5c4d7b2438d3 105 failedTestsCount = 0 # FAIL
switches 0:5c4d7b2438d3 106 passedTestsCount = 0 # OK
switches 0:5c4d7b2438d3 107 errorsTestsCount = 0 # ERROR
switches 0:5c4d7b2438d3 108 undefsTestsCount = 0 # UNDEF
switches 0:5c4d7b2438d3 109 testsResults = []
switches 0:5c4d7b2438d3 110
switches 0:5c4d7b2438d3 111 def __init__(self, stage=None,module=None, moduleset=None, **kwargs):
switches 0:5c4d7b2438d3 112 ShellCommand.__init__(self, **kwargs)
switches 0:5c4d7b2438d3 113 self.failedTestsCount = 0
switches 0:5c4d7b2438d3 114 self.passedTestsCount = 0
switches 0:5c4d7b2438d3 115 self.errorsTestsCount = 0
switches 0:5c4d7b2438d3 116 self.tracebackPyCount = 0
switches 0:5c4d7b2438d3 117 self.testsResults = []
switches 0:5c4d7b2438d3 118 testFailuresObserver = UnitTestsObserver ()
switches 0:5c4d7b2438d3 119 self.addLogObserver('stdio', testFailuresObserver)
switches 0:5c4d7b2438d3 120
switches 0:5c4d7b2438d3 121 def createSummary(self, log):
switches 0:5c4d7b2438d3 122 if self.failedTestsCount >= 0 or self.passedTestsCount >= 0 or self.errorsTestsCount >= 0 or self.undefsTestsCount >= 0:
switches 0:5c4d7b2438d3 123 self.addHTMLLog ('tests summary', self.createTestsSummary())
switches 0:5c4d7b2438d3 124
switches 0:5c4d7b2438d3 125 def getText(self, cmd, results):
switches 0:5c4d7b2438d3 126 text = ShellCommand.getText(self, cmd, results)
switches 0:5c4d7b2438d3 127 text.append("OK: " + str(self.passedTestsCount))
switches 0:5c4d7b2438d3 128 text.append("FAIL: " + str(self.failedTestsCount))
switches 0:5c4d7b2438d3 129 text.append("ERROR: " + str(self.errorsTestsCount))
switches 0:5c4d7b2438d3 130 text.append("UNDEF: " + str(self.undefsTestsCount))
switches 0:5c4d7b2438d3 131 text.append("Traceback: " + str(self.tracebackPyCount))
switches 0:5c4d7b2438d3 132 return text
switches 0:5c4d7b2438d3 133
switches 0:5c4d7b2438d3 134 def evaluateCommand(self, cmd):
switches 0:5c4d7b2438d3 135 if self.failedTestsCount > 0:
switches 0:5c4d7b2438d3 136 return buildbot.status.results.WARNINGS
switches 0:5c4d7b2438d3 137 elif self.errorsTestsCount > 0 or self.undefsTestsCount > 0 or self.tracebackPyCount > 0:
switches 0:5c4d7b2438d3 138 return buildbot.status.results.FAILURE
switches 0:5c4d7b2438d3 139 return buildbot.status.results.SUCCESS
switches 0:5c4d7b2438d3 140
switches 0:5c4d7b2438d3 141 def find_unique_tc_result_value(self, index):
switches 0:5c4d7b2438d3 142 """ Get unique values from each row in data parameter """
switches 0:5c4d7b2438d3 143 result = []
switches 0:5c4d7b2438d3 144 for tc_result_list in self.testsResults:
switches 0:5c4d7b2438d3 145 if tc_result_list[index] not in result:
switches 0:5c4d7b2438d3 146 result.append(tc_result_list[index])
switches 0:5c4d7b2438d3 147 return result
switches 0:5c4d7b2438d3 148
switches 0:5c4d7b2438d3 149 def html_view_test_result(self, targets, tests, toolchain):
switches 0:5c4d7b2438d3 150 """ Generates simple result table """
switches 0:5c4d7b2438d3 151 COLOR_OK = "LimeGreen"
switches 0:5c4d7b2438d3 152 COLOR_FAIL = "LightCoral"
switches 0:5c4d7b2438d3 153 COLOR_UNDEF = "LightSlateGray"
switches 0:5c4d7b2438d3 154 COLOR_NEUTRAL = "Silver"
switches 0:5c4d7b2438d3 155
switches 0:5c4d7b2438d3 156 STATUS_COLORS = { "OK" : COLOR_OK,
switches 0:5c4d7b2438d3 157 "FAIL" : COLOR_FAIL,
switches 0:5c4d7b2438d3 158 "UNDEF" : COLOR_UNDEF}
switches 0:5c4d7b2438d3 159
switches 0:5c4d7b2438d3 160 result = "<table>"
switches 0:5c4d7b2438d3 161 result += "<tr valign='center'><td align='center'><b>" + toolchain + "</b></td>"
switches 0:5c4d7b2438d3 162 for test in tests:
switches 0:5c4d7b2438d3 163 result += "<td align='center'>" + test + "<br></td>"
switches 0:5c4d7b2438d3 164 result += "</tr>"
switches 0:5c4d7b2438d3 165
switches 0:5c4d7b2438d3 166 for target in targets:
switches 0:5c4d7b2438d3 167 result += "<tr><td width='110px'><br>" + target + "<br></td>"
switches 0:5c4d7b2438d3 168 for test in tests:
switches 0:5c4d7b2438d3 169 for tc_result_list in self.testsResults:
switches 0:5c4d7b2438d3 170 if tc_result_list[1] == target and tc_result_list[2] == toolchain and tc_result_list[3] == test:
switches 0:5c4d7b2438d3 171 status = tc_result_list[4]
switches 0:5c4d7b2438d3 172 bgcolor = STATUS_COLORS[status]
switches 0:5c4d7b2438d3 173 result += "<td align='center' bgcolor='" + bgcolor + "'>" + status + "</td>"
switches 0:5c4d7b2438d3 174 break;
switches 0:5c4d7b2438d3 175 else:
switches 0:5c4d7b2438d3 176 result += "<td bgcolor='" + COLOR_NEUTRAL + "'></td>"
switches 0:5c4d7b2438d3 177 result += "</tr>"
switches 0:5c4d7b2438d3 178 result += "</table>"
switches 0:5c4d7b2438d3 179 return result
switches 0:5c4d7b2438d3 180
switches 0:5c4d7b2438d3 181 def createTestsSummary (self):
switches 0:5c4d7b2438d3 182 targets = self.find_unique_tc_result_value(1)
switches 0:5c4d7b2438d3 183 toolchains = self.find_unique_tc_result_value(2)
switches 0:5c4d7b2438d3 184 tests = self.find_unique_tc_result_value(3)
switches 0:5c4d7b2438d3 185 html_result = ""
switches 0:5c4d7b2438d3 186 for toolchain in toolchains:
switches 0:5c4d7b2438d3 187 html_result += self.html_view_test_result(targets, tests, toolchain)
switches 0:5c4d7b2438d3 188 html_result += "<br>"
switches 0:5c4d7b2438d3 189 return html_result
switches 0:5c4d7b2438d3 190
switches 0:5c4d7b2438d3 191
switches 0:5c4d7b2438d3 192 class UnitTestsObserver(LogLineObserver):
switches 0:5c4d7b2438d3 193 reGroupTestResult = []
switches 0:5c4d7b2438d3 194 reGroupPyResult = []
switches 0:5c4d7b2438d3 195
switches 0:5c4d7b2438d3 196 def __init__(self):
switches 0:5c4d7b2438d3 197 LogLineObserver.__init__(self)
switches 0:5c4d7b2438d3 198 if len(self.reGroupTestResult) == 0:
switches 0:5c4d7b2438d3 199 self.reGroupTestResult.append(re.compile("^(\w+Test)::(\w+)::(\w+)::(\w+)::.* \[(\w+)\] in (\d+\.\d+) of (\d+) sec[\r\n]*$"))
switches 0:5c4d7b2438d3 200
switches 0:5c4d7b2438d3 201 def outLineReceived(self, line):
switches 0:5c4d7b2438d3 202 matched = False
switches 0:5c4d7b2438d3 203 for r in self.reGroupTestResult:
switches 0:5c4d7b2438d3 204 result = r.match(line)
switches 0:5c4d7b2438d3 205 if result:
switches 0:5c4d7b2438d3 206 self.step.testsResults.append(result.groups())
switches 0:5c4d7b2438d3 207 if result.group(5) == 'OK':
switches 0:5c4d7b2438d3 208 self.step.passedTestsCount += 1
switches 0:5c4d7b2438d3 209 elif result.group(5) == 'FAIL':
switches 0:5c4d7b2438d3 210 self.step.failedTestsCount += 1
switches 0:5c4d7b2438d3 211 elif result.group(5) == 'UNDEF':
switches 0:5c4d7b2438d3 212 self.step.undefsTestsCount += 1
switches 0:5c4d7b2438d3 213 elif result.group(5) == 'ERROR':
switches 0:5c4d7b2438d3 214 self.step.errorsTestsCount += 1
switches 0:5c4d7b2438d3 215 matched = True
switches 0:5c4d7b2438d3 216
switches 0:5c4d7b2438d3 217
switches 0:5c4d7b2438d3 218 class BuildCommand(ShellCommand):
switches 0:5c4d7b2438d3 219 warningsCount = 0 # [Warning]
switches 0:5c4d7b2438d3 220 errorsCount = 0 # [Error]
switches 0:5c4d7b2438d3 221 testsResults = []
switches 0:5c4d7b2438d3 222
switches 0:5c4d7b2438d3 223 def __init__(self, stage=None,module=None, moduleset=None, **kwargs):
switches 0:5c4d7b2438d3 224 ShellCommand.__init__(self, **kwargs)
switches 0:5c4d7b2438d3 225 self.warningsCount = 0
switches 0:5c4d7b2438d3 226 self.errorsCount = 0
switches 0:5c4d7b2438d3 227 self.testsResults = []
switches 0:5c4d7b2438d3 228 buildProcessObserver = BuildObserver ()
switches 0:5c4d7b2438d3 229 self.addLogObserver('stdio', buildProcessObserver)
switches 0:5c4d7b2438d3 230
switches 0:5c4d7b2438d3 231 def createSummary(self, log):
switches 0:5c4d7b2438d3 232 if self.warningsCount >= 0 or self.errorsCount >= 0:
switches 0:5c4d7b2438d3 233 self.addHTMLLog ('tests summary', self.createTestsSummary())
switches 0:5c4d7b2438d3 234
switches 0:5c4d7b2438d3 235 def getText(self, cmd, results):
switches 0:5c4d7b2438d3 236 text = ShellCommand.getText(self, cmd, results)
switches 0:5c4d7b2438d3 237 if self.warningsCount > 0 or self.errorsCount > 0:
switches 0:5c4d7b2438d3 238 text.append("warnings: " + str(self.warningsCount))
switches 0:5c4d7b2438d3 239 text.append("errors: " + str(self.errorsCount))
switches 0:5c4d7b2438d3 240 return text
switches 0:5c4d7b2438d3 241
switches 0:5c4d7b2438d3 242 def evaluateCommand(self, cmd):
switches 0:5c4d7b2438d3 243 if self.warningsCount > 0:
switches 0:5c4d7b2438d3 244 return buildbot.status.results.WARNINGS
switches 0:5c4d7b2438d3 245 elif self.errorsCount > 0:
switches 0:5c4d7b2438d3 246 return buildbot.status.results.FAILURE
switches 0:5c4d7b2438d3 247 else:
switches 0:5c4d7b2438d3 248 return buildbot.status.results.SUCCESS
switches 0:5c4d7b2438d3 249
switches 0:5c4d7b2438d3 250 def createTestsSummary (self):
switches 0:5c4d7b2438d3 251 # Create a string with your html report and return it
switches 0:5c4d7b2438d3 252 html = "<h4>Report</h4><table>"
switches 0:5c4d7b2438d3 253 #for result in self.testsResults:
switches 0:5c4d7b2438d3 254 html += "</table>"
switches 0:5c4d7b2438d3 255 return html
switches 0:5c4d7b2438d3 256
switches 0:5c4d7b2438d3 257 class BuildObserver(LogLineObserver):
switches 0:5c4d7b2438d3 258 regroupresult = []
switches 0:5c4d7b2438d3 259
switches 0:5c4d7b2438d3 260 def __init__(self):
switches 0:5c4d7b2438d3 261 LogLineObserver.__init__(self)
switches 0:5c4d7b2438d3 262 if len(self.regroupresult) == 0:
switches 0:5c4d7b2438d3 263 self.regroupresult.append(re.compile("^\[([Ww]arning)\] (.*)"))
switches 0:5c4d7b2438d3 264 self.regroupresult.append(re.compile("^\[([Ee]rror)\] (.*)"))
switches 0:5c4d7b2438d3 265
switches 0:5c4d7b2438d3 266 def outLineReceived(self, line):
switches 0:5c4d7b2438d3 267 matched = False
switches 0:5c4d7b2438d3 268 for r in self.regroupresult:
switches 0:5c4d7b2438d3 269 result = r.match(line)
switches 0:5c4d7b2438d3 270 if result:
switches 0:5c4d7b2438d3 271 self.step.testsResults.append(result.groups())
switches 0:5c4d7b2438d3 272 if result.group(1) == 'Warning':
switches 0:5c4d7b2438d3 273 self.step.warningsCount += 1
switches 0:5c4d7b2438d3 274 elif result.group(1) == 'Error':
switches 0:5c4d7b2438d3 275 self.step.errorsCount += 1
switches 0:5c4d7b2438d3 276 matched = True
switches 0:5c4d7b2438d3 277 #if not matched:
switches 0:5c4d7b2438d3 278 # [Future-Dev] Other check...
switches 0:5c4d7b2438d3 279
switches 0:5c4d7b2438d3 280
switches 0:5c4d7b2438d3 281 ####### BUILDERS - mbed project
switches 0:5c4d7b2438d3 282 git_clone = Git(repourl='https://github.com/mbedmicro/mbed.git', mode='incremental')
switches 0:5c4d7b2438d3 283
switches 0:5c4d7b2438d3 284 # create the build factory for mbed and add the steps to it
switches 0:5c4d7b2438d3 285 from buildbot.config import BuilderConfig
switches 0:5c4d7b2438d3 286
switches 0:5c4d7b2438d3 287 c['builders'] = []
switches 0:5c4d7b2438d3 288
switches 0:5c4d7b2438d3 289 copy_mbed_settings = ShellCommand(name = "copy mbed_settings.py",
switches 0:5c4d7b2438d3 290 command = "cp ../mbed_settings.py mbed_settings.py",
switches 0:5c4d7b2438d3 291 haltOnFailure = True,
switches 0:5c4d7b2438d3 292 description = "Copy mbed_settings.py")
switches 0:5c4d7b2438d3 293
switches 0:5c4d7b2438d3 294 mbed_build_release = BuildFactory()
switches 0:5c4d7b2438d3 295 mbed_build_release.addStep(git_clone)
switches 0:5c4d7b2438d3 296 mbed_build_release.addStep(copy_mbed_settings)
switches 0:5c4d7b2438d3 297
switches 0:5c4d7b2438d3 298 for target_name, toolchains in OFFICIAL_MBED_LIBRARY_BUILD:
switches 0:5c4d7b2438d3 299 builder_name = "All_TC_%s" % target_name
switches 0:5c4d7b2438d3 300 mbed_build = BuildFactory()
switches 0:5c4d7b2438d3 301 mbed_build.addStep(git_clone)
switches 0:5c4d7b2438d3 302 mbed_build.addStep(copy_mbed_settings)
switches 0:5c4d7b2438d3 303 # Adding all chains for target
switches 0:5c4d7b2438d3 304 for toolchain in toolchains:
switches 0:5c4d7b2438d3 305 build_py = BuildCommand(name = "Build %s using %s" % (target_name, toolchain),
switches 0:5c4d7b2438d3 306 command = "python tools/build.py -m %s -t %s" % (target_name, toolchain),
switches 0:5c4d7b2438d3 307 haltOnFailure = True,
switches 0:5c4d7b2438d3 308 warnOnWarnings = True,
switches 0:5c4d7b2438d3 309 description = "Building %s using %s" % (target_name, toolchain),
switches 0:5c4d7b2438d3 310 descriptionDone = "Built %s using %s" % (target_name, toolchain))
switches 0:5c4d7b2438d3 311
switches 0:5c4d7b2438d3 312 mbed_build.addStep(build_py)
switches 0:5c4d7b2438d3 313 mbed_build_release.addStep(build_py) # For build release we need all toolchains
switches 0:5c4d7b2438d3 314
switches 0:5c4d7b2438d3 315 if target_name in OFFICIAL_MBED_TESTBED_SUPPORTED_HARDWARE:
switches 0:5c4d7b2438d3 316 copy_example_test_spec_json = ShellCommand(name = "Copy example_test_spec.json",
switches 0:5c4d7b2438d3 317 command = "cp ../example_test_spec.json tools/data/example_test_spec.json",
switches 0:5c4d7b2438d3 318 haltOnFailure = True,
switches 0:5c4d7b2438d3 319 description = "Copy example_test_spec.json")
switches 0:5c4d7b2438d3 320
switches 0:5c4d7b2438d3 321 autotest_py = ShellCommand(name = "Running autotest.py for %s" % (target_name),
switches 0:5c4d7b2438d3 322 command = "python tools/autotest.py tools/data/example_test_spec.json",
switches 0:5c4d7b2438d3 323 haltOnFailure = True,
switches 0:5c4d7b2438d3 324 description = "Running autotest.py")
switches 0:5c4d7b2438d3 325
switches 0:5c4d7b2438d3 326 mbed_build.addStep(copy_example_test_spec_json)
switches 0:5c4d7b2438d3 327 mbed_build.addStep(autotest_py)
switches 0:5c4d7b2438d3 328
switches 0:5c4d7b2438d3 329 # Add builder with steps for each toolchain
switches 0:5c4d7b2438d3 330 c['builders'].append(BuilderConfig(name=builder_name,
switches 0:5c4d7b2438d3 331 slavenames=["example-slave-%s" % (target_name)],
switches 0:5c4d7b2438d3 332 factory=mbed_build))
switches 0:5c4d7b2438d3 333 else:
switches 0:5c4d7b2438d3 334 # Add builder with steps for each toolchain
switches 0:5c4d7b2438d3 335 c['builders'].append(BuilderConfig(name=builder_name,
switches 0:5c4d7b2438d3 336 slavenames=["example-slave"],
switches 0:5c4d7b2438d3 337 factory=mbed_build))
switches 0:5c4d7b2438d3 338
switches 0:5c4d7b2438d3 339 # copy_example_test_spec_json = ShellCommand(name = "Copy example_test_spec.json",
switches 0:5c4d7b2438d3 340 # command = "cp ../example_test_spec.json tools/data/example_test_spec.json",
switches 0:5c4d7b2438d3 341 # haltOnFailure = True,
switches 0:5c4d7b2438d3 342 # description = "Copy example_test_spec.json")
switches 0:5c4d7b2438d3 343
switches 0:5c4d7b2438d3 344 singletest_py = TestCommand(name = "Running Target Tests",
switches 0:5c4d7b2438d3 345 command = "python tools/singletest.py -i tools/test_spec.json -M tools/muts_all.json",
switches 0:5c4d7b2438d3 346 haltOnFailure = True,
switches 0:5c4d7b2438d3 347 warnOnWarnings = True,
switches 0:5c4d7b2438d3 348 description = "Running Target Tests",
switches 0:5c4d7b2438d3 349 descriptionDone = "Target Testing Finished")
switches 0:5c4d7b2438d3 350
switches 0:5c4d7b2438d3 351 mbed_build_release.addStep(singletest_py)
switches 0:5c4d7b2438d3 352 # Release build collects all building toolchains
switches 0:5c4d7b2438d3 353 c['builders'].append(BuilderConfig(name=release_builder_name,
switches 0:5c4d7b2438d3 354 slavenames=["example-slave"],
switches 0:5c4d7b2438d3 355 factory=mbed_build_release))
switches 0:5c4d7b2438d3 356
switches 0:5c4d7b2438d3 357 ####### STATUS TARGETS
switches 0:5c4d7b2438d3 358
switches 0:5c4d7b2438d3 359 # 'status' is a list of Status Targets. The results of each build will be
switches 0:5c4d7b2438d3 360 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
switches 0:5c4d7b2438d3 361 # including web pages, email senders, and IRC bots.
switches 0:5c4d7b2438d3 362
switches 0:5c4d7b2438d3 363 c['status'] = []
switches 0:5c4d7b2438d3 364
switches 0:5c4d7b2438d3 365 from buildbot.status import html
switches 0:5c4d7b2438d3 366 from buildbot.status.web import authz, auth
switches 0:5c4d7b2438d3 367
switches 0:5c4d7b2438d3 368 authz_cfg=authz.Authz(
switches 0:5c4d7b2438d3 369 # change any of these to True to enable; see the manual for more
switches 0:5c4d7b2438d3 370 # options
switches 0:5c4d7b2438d3 371 auth=auth.BasicAuth([("pyflakes","pyflakes")]),
switches 0:5c4d7b2438d3 372 gracefulShutdown = False,
switches 0:5c4d7b2438d3 373 forceBuild = 'auth', # use this to test your slave once it is set up
switches 0:5c4d7b2438d3 374 forceAllBuilds = True,
switches 0:5c4d7b2438d3 375 pingBuilder = True,
switches 0:5c4d7b2438d3 376 stopBuild = True,
switches 0:5c4d7b2438d3 377 stopAllBuilds = True,
switches 0:5c4d7b2438d3 378 cancelPendingBuild = True,
switches 0:5c4d7b2438d3 379 )
switches 0:5c4d7b2438d3 380 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg, order_console_by_time=True))
switches 0:5c4d7b2438d3 381
switches 0:5c4d7b2438d3 382 ####### PROJECT IDENTITY
switches 0:5c4d7b2438d3 383
switches 0:5c4d7b2438d3 384 # the 'title' string will appear at the top of this buildbot
switches 0:5c4d7b2438d3 385 # installation's html.WebStatus home page (linked to the
switches 0:5c4d7b2438d3 386 # 'titleURL') and is embedded in the title of the waterfall HTML page.
switches 0:5c4d7b2438d3 387
switches 0:5c4d7b2438d3 388 c['title'] = "Green Tea"
switches 0:5c4d7b2438d3 389 c['titleURL'] = ""
switches 0:5c4d7b2438d3 390
switches 0:5c4d7b2438d3 391 # the 'buildbotURL' string should point to the location where the buildbot's
switches 0:5c4d7b2438d3 392 # internal web server (usually the html.WebStatus page) is visible. This
switches 0:5c4d7b2438d3 393 # typically uses the port number set in the Waterfall 'status' entry, but
switches 0:5c4d7b2438d3 394 # with an externally-visible host name which the buildbot cannot figure out
switches 0:5c4d7b2438d3 395 # without some help.
switches 0:5c4d7b2438d3 396
switches 0:5c4d7b2438d3 397 c['buildbotURL'] = "http://localhost:8010/"
switches 0:5c4d7b2438d3 398
switches 0:5c4d7b2438d3 399 ####### DB URL
switches 0:5c4d7b2438d3 400
switches 0:5c4d7b2438d3 401 c['db'] = {
switches 0:5c4d7b2438d3 402 # This specifies what database buildbot uses to store its state. You can leave
switches 0:5c4d7b2438d3 403 # this at its default for all but the largest installations.
switches 0:5c4d7b2438d3 404 'db_url' : "sqlite:///state.sqlite",
switches 0:5c4d7b2438d3 405 # 'db_url' : "mysql://buildbot:123456@localhost/buildbot_mbed?max_idle=300",
switches 0:5c4d7b2438d3 406 }