| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import ntpath | 5 import ntpath |
| 6 import posixpath | 6 import posixpath |
| 7 import re | 7 import re |
| 8 from buildbot.process import factory | 8 from buildbot.process import factory |
| 9 from buildbot.process.properties import WithProperties | 9 from buildbot.process.properties import WithProperties |
| 10 from buildbot.steps.source import SVN | 10 from buildbot.steps.source import SVN |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 'media_unittests', | 40 'media_unittests', |
| 41 'net_unittests', | 41 'net_unittests', |
| 42 'printing_unittests', | 42 'printing_unittests', |
| 43 'remoting_unittests', | 43 'remoting_unittests', |
| 44 'sql_unittests', | 44 'sql_unittests', |
| 45 'unit_tests', | 45 'unit_tests', |
| 46 'url_unittests', | 46 'url_unittests', |
| 47 ] | 47 ] |
| 48 | 48 |
| 49 | 49 |
| 50 def WindowsToOs(windows): | 50 def BotToPlatform(bot_platform): |
| 51 """Takes a boolean windows value and returns a platform string.""" | 51 """Takes a bot platform value and returns a platform string.""" |
| 52 if windows: | 52 if bot_platform.startswith('win'): |
| 53 return 'windows' | 53 return 'windows' |
| 54 elif bot_platform.startswith('linux'): |
| 55 return 'linux' |
| 56 elif bot_platform.startswith('mac'): |
| 57 return 'mac' |
| 54 else: | 58 else: |
| 55 return 'linux' | 59 raise ValueError('Unknown platform %s' % platform) |
| 56 | 60 |
| 57 | 61 |
| 58 def OsFullName(platform): | 62 def OsFullName(platform): |
| 59 if platform.startswith('win'): | 63 if platform.startswith('win'): |
| 60 return 'Windows' | 64 return 'Windows' |
| 61 elif platform.startswith('linux'): | 65 elif platform.startswith('linux'): |
| 62 return 'Linux' | 66 return 'Linux' |
| 63 else: | 67 else: |
| 64 raise ValueError('Unknown platform %s' % platform) | 68 raise ValueError('Unknown platform %s' % platform) |
| 65 | 69 |
| 66 | 70 |
| 67 def OsShortName(platform): | 71 def OsShortName(platform): |
| 68 if platform.startswith('win'): | 72 if platform.startswith('win'): |
| 69 return 'win' | 73 return 'win' |
| 70 elif platform.startswith('linux'): | 74 elif platform.startswith('linux'): |
| 71 return 'linux' | 75 return 'linux' |
| 76 elif platform.startswith('mac'): |
| 77 return 'mac' |
| 72 else: | 78 else: |
| 73 raise ValueError('Unknown platform %s' % platform) | 79 raise ValueError('Unknown platform %s' % platform) |
| 74 | 80 |
| 75 | 81 |
| 76 def ArchToBits(arch): | 82 def ArchToBits(arch): |
| 77 """Takes an arch string like x64 and ia32 and returns its bitwidth.""" | 83 """Takes an arch string like x64 and ia32 and returns its bitwidth.""" |
| 78 if not arch: # Default to x64. | 84 if not arch: # Default to x64. |
| 79 return 64 | 85 return 64 |
| 80 elif arch == 'x64': | 86 elif arch == 'x64': |
| 81 return 64 | 87 return 64 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 98 self.factory = build_factory | 104 self.factory = build_factory |
| 99 self.target_platform = OsShortName(target_platform) | 105 self.target_platform = OsShortName(target_platform) |
| 100 self.os_version = os_version | 106 self.os_version = os_version |
| 101 | 107 |
| 102 def IsWindows(self): | 108 def IsWindows(self): |
| 103 """Returns true if we're targetting Windows.""" | 109 """Returns true if we're targetting Windows.""" |
| 104 return self.target_platform.startswith('win') | 110 return self.target_platform.startswith('win') |
| 105 | 111 |
| 106 def IsMac(self): | 112 def IsMac(self): |
| 107 """Returns true if we're targetting Mac OSX.""" | 113 """Returns true if we're targetting Mac OSX.""" |
| 108 return self.target_platform.startswith('darwin') | 114 return self.target_platform.startswith('mac') |
| 109 | 115 |
| 110 def PathJoin(self, *args): | 116 def PathJoin(self, *args): |
| 111 """Join paths using the separator of the os of the bot.""" | 117 """Join paths using the separator of the os of the bot.""" |
| 112 if self.IsWindows(): | 118 if self.IsWindows(): |
| 113 return ntpath.normpath(ntpath.join(*args)) | 119 return ntpath.normpath(ntpath.join(*args)) |
| 114 else: | 120 else: |
| 115 return posixpath.normpath(posixpath.join(*args)) | 121 return posixpath.normpath(posixpath.join(*args)) |
| 116 | 122 |
| 117 def AddStep(self, step_class, **kwargs): | 123 def AddStep(self, step_class, **kwargs): |
| 118 """Adds a regular buildbot step.""" | 124 """Adds a regular buildbot step.""" |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 | 618 |
| 613 | 619 |
| 614 def DynamoRIONightlyFactory(os='', os_version=''): | 620 def DynamoRIONightlyFactory(os='', os_version=''): |
| 615 return DrCommands(os, os_version).DynamoRIONightly() | 621 return DrCommands(os, os_version).DynamoRIONightly() |
| 616 | 622 |
| 617 | 623 |
| 618 def DynamoRIOPackageFactory(os='', os_version=''): | 624 def DynamoRIOPackageFactory(os='', os_version=''): |
| 619 return DrCommands(os, os_version).DynamoRIOPackage() | 625 return DrCommands(os, os_version).DynamoRIOPackage() |
| 620 | 626 |
| 621 | 627 |
| 622 def CreateDrMFactory(windows): | 628 def CreateDrMFactory(bot_platform): |
| 623 # Build and run the drmemory pre-commit suite. | 629 # Build and run the drmemory pre-commit suite. |
| 624 cmds = DrCommands(WindowsToOs(windows)) | 630 cmds = DrCommands(BotToPlatform(bot_platform)) |
| 625 cmds.DrMemorySuite() | 631 cmds.DrMemorySuite() |
| 626 if cmds.IsWindows(): | 632 if cmds.IsWindows(): |
| 627 cmds.AddTSanTestBuild() | 633 cmds.AddTSanTestBuild() |
| 628 cmds.AddDrMemoryTSanTests() | 634 cmds.AddDrMemoryTSanTests() |
| 629 # We used to kill stale drmemory processes, but now we use auto-reboot. | 635 # We used to kill stale drmemory processes, but now we use auto-reboot. |
| 630 cmds.AddDrMemoryLogsUpload() | 636 cmds.AddDrMemoryLogsUpload() |
| 631 return cmds.factory | 637 return cmds.factory |
| 632 | 638 |
| 633 | 639 |
| 634 def CreateDrMPackageFactory(windows): | 640 def CreateDrMPackageFactory(bot_platform): |
| 635 return DrCommands(WindowsToOs(windows)).DrMemoryPackage() | 641 return DrCommands(BotToPlatform(bot_platform)).DrMemoryPackage() |
| 636 | 642 |
| 637 | 643 |
| 638 def CreateWinChromeFactory(builder): | 644 def CreateWinChromeFactory(builder): |
| 639 """Run chrome tests with the latest drmemory. | 645 """Run chrome tests with the latest drmemory. |
| 640 | 646 |
| 641 Do *not* build TOT chrome or sync it. Building chrome takes a lot of | 647 Do *not* build TOT chrome or sync it. Building chrome takes a lot of |
| 642 resources and the tests are flaky, so we only do at known good revisions. We | 648 resources and the tests are flaky, so we only do at known good revisions. We |
| 643 don't want to fall too far behind, or we're not really testing Chrome's full | 649 don't want to fall too far behind, or we're not really testing Chrome's full |
| 644 test suite. | 650 test suite. |
| 645 """ | 651 """ |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 # TODO(rnk): We should run some selection of layout tests if we want to | 777 # TODO(rnk): We should run some selection of layout tests if we want to |
| 772 # verify output. | 778 # verify output. |
| 773 ret.addStep(Test(command=cmd, | 779 ret.addStep(Test(command=cmd, |
| 774 env={'CHROME_DEVEL_SANDBOX': | 780 env={'CHROME_DEVEL_SANDBOX': |
| 775 '/opt/chromium/chrome_sandbox'}, | 781 '/opt/chromium/chrome_sandbox'}, |
| 776 name=test, | 782 name=test, |
| 777 descriptionDone=test, | 783 descriptionDone=test, |
| 778 description=test)) | 784 description=test)) |
| 779 | 785 |
| 780 return ret | 786 return ret |
| OLD | NEW |