Home | History | Annotate | Download | only in examples
      1 # Copyright 2017 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 
      6 DEPS = [
      7   'builder_name_schema',
      8 ]
      9 
     10 
     11 def RunSteps(api):
     12   name = 'Build-Debian9-Clang-x64-Release-Android'
     13   d = api.builder_name_schema.DictForBuilderName(name)
     14   got = api.builder_name_schema.MakeBuilderName(**d)
     15   assert got == name
     16 
     17   # Failures.
     18   try:
     19     api.builder_name_schema.MakeBuilderName('nope')
     20   except ValueError:
     21     pass
     22 
     23   try:
     24     api.builder_name_schema.MakeBuilderName(
     25         role='Build', os='a%sb' % api.builder_name_schema.BUILDER_NAME_SEP)
     26   except ValueError:
     27     pass
     28 
     29   try:
     30     api.builder_name_schema.MakeBuilderName(role='Build', bogus='BOGUS')
     31   except ValueError:
     32     pass
     33 
     34   try:
     35     api.builder_name_schema.MakeBuilderName(
     36         role='Build',
     37         os='Debian9',
     38         compiler='Clang',
     39         target_arch='x64',
     40         configuration='Release',
     41         extra_config='A%sB' % api.builder_name_schema.BUILDER_NAME_SEP)
     42   except ValueError:
     43     pass
     44 
     45   try:
     46     api.builder_name_schema.DictForBuilderName('Build-')
     47   except ValueError:
     48     pass
     49 
     50   try:
     51     api.builder_name_schema.DictForBuilderName(
     52         'Build-Debian9-Clang-x64-Release-Android-Bogus')
     53   except ValueError:
     54     pass
     55 
     56   try:
     57     api.builder_name_schema.DictForBuilderName(
     58         'Bogus-Debian9-Clang-x64-Release-Android')
     59   except ValueError:
     60     pass
     61 
     62 
     63 def GenTests(api):
     64   yield api.test('test')
     65