dhgdh

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by joey shelton

Committer:
cyberjoey
Date:
Sat Oct 22 01:31:58 2016 +0000
Revision:
9:6bb35cef007d
Parent:
1:55a6170b404f
WORKING

Who changed what in which revision?

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