Example #1
0
def main():
  context = buildbot_lib.BuildContext()
  buildbot_lib.SetDefaultContextAttributes(context)
  context['max_jobs'] = int(os.environ.get('PNACL_CONCURRENCY', 4))
  status = buildbot_lib.BuildStatus(context)

  # TODO(dschuff): it's a pain to pass through unknown arguments with optparse,
  # but if we add more, or once we have argparse (python2.7) everywhere, switch.
  try:
    compiler = sys.argv[1]
    platform = sys.argv[2]
    tester_argv = sys.argv[3:]
  except IndexError:
    usage()
    sys.exit(1)

  return run_torture(status, compiler, platform, tester_argv)
                                          ],
                    help='Build with corresponding sanitizer')
parser.add_argument('--no-goma', action='store_true', default=False,
                    help='Do not run with goma')
args = parser.parse_args()

host_os = buildbot_lib.GetHostPlatform()

if args.sanitize:
  if host_os != 'linux' or args.tests_arch != 'x86-64':
    raise Exception("Error: Can't run sanitize bot unless linux x86-64")

# This is a minimal context, not useful for running tests yet, but enough for
# basic Step handling.
context = buildbot_lib.BuildContext()
buildbot_lib.SetDefaultContextAttributes(context)
context['pnacl'] = True
status = buildbot_lib.BuildStatus(context)

toolchain_install_dir = os.path.join(
    NACL_DIR,
    'toolchain',
    '%s_%s' % (host_os, pynacl.platform.GetArch()),
    'pnacl_newlib')

use_goma = buildbot_lib.RunningOnBuildbot() and not args.no_goma


def ToolchainBuildCmd(sync=False, extra_flags=[]):
  sync_flag = ['--sync'] if sync else []
  executable_args = [os.path.join('toolchain_build','toolchain_build_pnacl.py'),