3 from buildbot.process import step
4 from buildbot.process.step import ShellCommand
5 from buildbot.status import builder
6 from buildbot.status.builder import SUCCESS,FAILURE, EXCEPTION,WARNINGS
8 # Define a new builder status
9 # Configure return the exit code 77 when the target platform don't
10 # bear ucontext functionnality. In this case the CustomConfigure returns
11 # INCOMPATIBLE_PLATFORM.
13 INCOMPATIBLE_PLATFORM = EXCEPTION +1
16 CustomConfigure class for master-side representation of the
17 custom configure command. This class considers the error (exit code 77)
18 that occurs when the platform target don't bear ucontext functionnality.
20 class CustomConfigure(ShellCommand):
23 description = ["running configure"]
24 descriptionDone = [name]
26 # Override evaluateCommand method to handle the case of platform that
27 # don't support ucontext. The method returns INCOMPATIBLE_PLATFORM
30 def evaluateCommand(self, cmd):
31 """Decide whether the command was SUCCESS, INCOMPATIBLE_PLATFORM,
37 builder.Results.append('incompatible_platform')
38 return INCOMPATIBLE_PLATFORM
42 # Override getColor method. The method returns the text "yellow"
43 # when the results parameter is INCOMPATIBLE_PLATFORM.
45 def getColor(self, cmd, results):
46 assert results in (SUCCESS, WARNINGS, FAILURE,INCOMPATIBLE_PLATFORM)
47 if results == SUCCESS:
49 elif results == WARNINGS:
51 elif results == INCOMPATIBLE_PLATFORM:
56 # Override getText method. The method calls describe method
57 # with the text "failed {incompatible platform}" when the platform
58 # don't support ucontext functionnality.
60 def getText(self, cmd, results):
61 if results == SUCCESS:
62 return self.describe(True) + ["Configure success"]
63 elif results == WARNINGS:
64 return self.describe(True) + ["warnings"]
65 elif results == INCOMPATIBLE_PLATFORM:
66 return self.describe(True) + ["failed {incompatible platform}"]
68 return self.describe(True) + ["failed"]