def StepRunSelLdrTests(pepperdir):
    filters = {'SEL_LDR': True}

    tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, include=filters)

    def RunTest(test, toolchain, arch, config):
        args = ['TOOLCHAIN=%s' % toolchain, 'NACL_ARCH=%s' % arch]
        args += ['SEL_LDR=1', 'run']
        build_projects.BuildProjectsBranch(pepperdir,
                                           test,
                                           clean=False,
                                           deps=False,
                                           config=config,
                                           args=args)

    if getos.GetPlatform() == 'win':
        # On win32 we only support running on the system
        # arch
        archs = (getos.GetSystemArch('win'), )
    elif getos.GetPlatform() == 'mac':
        # We only ship 32-bit version of sel_ldr on mac.
        archs = ('x86_32', )
    else:
        # On linux we can run both 32 and 64-bit
        archs = ('x86_64', 'x86_32')

    for root, projects in tree.iteritems():
        for project in projects:
            title = 'sel_ldr tests: %s' % os.path.basename(project['NAME'])
            location = os.path.join(root, project['NAME'])
            buildbot_common.BuildStep(title)
            for toolchain in ('newlib', 'glibc'):
                for arch in archs:
                    for config in ('Debug', 'Release'):
                        RunTest(location, toolchain, arch, config)
Пример #2
0
def StepRunSelLdrTests(pepperdir, sanitizer):
  filters = {
    'SEL_LDR': True
  }

  tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, include=filters)

  def RunTest(test, toolchain, config, arch=None):
    args = ['STANDALONE=1', 'TOOLCHAIN=%s' % toolchain]
    args += GetSanitizerArgs(sanitizer)
    if arch is not None:
      args.append('NACL_ARCH=%s' % arch)

    build_projects.BuildProjectsBranch(pepperdir, test, clean=False,
                                       deps=False, config=config,
                                       args=args + ['run'])

  if getos.GetPlatform() == 'win':
    # On win32 we only support running on the system
    # arch
    archs = (getos.GetSystemArch('win'),)
  elif getos.GetPlatform() == 'mac':
    # We only ship 64-bit version of sel_ldr on mac.
    archs = ('x86_64',)
  else:
    # On linux we can run both 32 and 64-bit, and arm (via qemu)
    archs = ('x86_64', 'x86_32', 'arm')

  for root, projects in tree.iteritems():
    for project in projects:
      if sanitizer:
        sanitizer_name = '[sanitizer=%s]'  % sanitizer
      else:
        sanitizer_name = ''
      title = 'standalone test%s: %s' % (sanitizer_name,
                                         os.path.basename(project['NAME']))
      location = os.path.join(root, project['NAME'])
      buildbot_common.BuildStep(title)
      configs = ('Debug', 'Release')

      # On linux we can run the standalone tests natively using the host
      # compiler.
      if getos.GetPlatform() == 'linux':
        if sanitizer:
          configs = ('Debug',)
        for config in configs:
          RunTest(location, 'linux', config)

      if sanitizer:
        continue

      for toolchain in ('clang-newlib', 'glibc', 'pnacl'):
        for arch in archs:
          for config in configs:
            RunTest(location, toolchain, config, arch)
Пример #3
0
 def testGetSystemArch(self):
     """returns a valid architecture."""
     arch = getos.GetSystemArch(getos.GetPlatform())
     self.assertIn(arch, ('x86_64', 'x86_32', 'arm'))
Пример #4
0
def StepRunSelLdrTests(pepperdir, sanitizer):
    filters = {'SEL_LDR': True}

    tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, include=filters)

    def RunTest(test, toolchain, config, arch=None):
        args = ['STANDALONE=1', 'TOOLCHAIN=%s' % toolchain]
        if arch is not None:
            args.append('NACL_ARCH=%s' % arch)
        deps = False

        if sanitizer is not None:
            # For sanitizer builds we pass extra argument for make, and do
            # full clean build to make sure everything is rebuilt with the
            # correct flags
            deps = True
            if sanitizer == 'valgrind':
                args += ['RUN_UNDER=valgrind']
            elif sanitizer == 'address':
                args += ['ASAN=1']
            elif sanitizer == 'thread':
                args += ['TSAN=1']

        build_projects.BuildProjectsBranch(pepperdir,
                                           test,
                                           clean=False,
                                           deps=deps,
                                           config=config,
                                           args=args + ['run'])

    if getos.GetPlatform() == 'win':
        # On win32 we only support running on the system
        # arch
        archs = (getos.GetSystemArch('win'), )
    elif getos.GetPlatform() == 'mac':
        # We only ship 32-bit version of sel_ldr on mac.
        archs = ('x86_32', )
    else:
        # On linux we can run both 32 and 64-bit
        archs = ('x86_64', 'x86_32')

    for root, projects in tree.iteritems():
        for project in projects:
            if sanitizer:
                sanitizer_name = '[sanitizer=%s]' % sanitizer
            else:
                sanitizer_name = ''
            title = 'standalone test%s: %s' % (
                sanitizer_name, os.path.basename(project['NAME']))
            location = os.path.join(root, project['NAME'])
            buildbot_common.BuildStep(title)
            configs = ('Debug', 'Release')

            # On linux we can run the standalone tests natively using the host
            # compiler.
            if getos.GetPlatform() == 'linux':
                if sanitizer:
                    configs = ('Debug', )
                for config in configs:
                    RunTest(location, 'linux', config)

            if sanitizer:
                continue

            for toolchain in ('clang-newlib', 'newlib', 'glibc', 'pnacl'):
                for arch in archs:
                    for config in configs:
                        RunTest(location, toolchain, config, arch)