Sha256: eccec55166304f23cd881cd727648e64b822a621e30676be7b9603837dab543f

Contents?: true

Size: 1.52 KB

Versions: 28

Compression:

Stored size: 1.52 KB

Contents

# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from recipe_engine.config import List, Single, ConfigList, ConfigGroup
from recipe_engine.recipe_api import Property

DEPS = [
  'recipe_engine/path',
  'recipe_engine/platform',
  'recipe_engine/properties',
  'recipe_engine/step',
  'cipd',
]

PROPERTIES = {
  'arch_override': Property(kind=str, default=None),
  'bits_override': Property(kind=int, default=None),
  'expect_error': Property(kind=bool, default=False),
}

def RunSteps(api, arch_override, bits_override, expect_error):
  was_error = False
  try:
    api.step('platform_suffix', ['echo', api.cipd.platform_suffix(
      arch=arch_override,
      bits=bits_override,
    )])
  except KeyError:
    was_error = True

  assert was_error == expect_error


def GenTests(api):
  for name, arch, bits in (
      ('linux', 'intel', 32),
      ('linux', 'intel', 64),
      ('linux', 'mips', 64),
      ('linux', 'arm', 32),
      ('linux', 'arm', 64),
      ('mac', 'intel', 64),
      ('win', 'intel', 32),
      ('win', 'intel', 64)):
    test = (
      api.test('%s_%s_%d' % (name, arch, bits)) +
      api.platform(name, bits)
    )
    if arch != 'intel':
      test += api.properties(arch_override=arch)
    yield test

  yield (
      api.test('junk arch') +
      api.properties(arch_override='pants', expect_error=True))

  yield (
      api.test('junk bits') +
      api.properties(bits_override=42, expect_error=True))

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
libv8-8.4.255.0.1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-8.4.255.0 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-7.8.279.23.0beta1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-7.4.288.28.0beta1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-7.3.492.27.3beta1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-7.3.492.27.1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-7.3.492.27.0 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-7.3.492.27.0beta1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.7.288.46.1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.7.288.46.0 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.7.288.46.1beta0 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.3.292.48.1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.3.292.48.0 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.3.292.48.0beta2 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.3.292.48.0beta1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.2.414.42.1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.2.414.42.0 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.2.414.42.0beta1 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.0.286.54.3 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py
libv8-6.0.286.54.2 vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py