Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    ra2f2fda rabec2f8  
    2323class Architecture:
    2424        KnownArchitectures = {
    25                 'x64'         : 'x64',
    26                 'x86-64'      : 'x64',
    27                 'x86_64'      : 'x64',
    28                 'x86'         : 'x86',
    29                 'aarch64'     : 'arm64',
    30                 'arm64'       : 'arm64',
    31                 'ARM64'       : 'arm64',
    32                 'i386'        : 'x86',
    33                 'i486'        : 'x86',
    34                 'i686'        : 'x86',
    35                 'Intel 80386' : 'x86',
    36                 'arm'         : 'arm32',
    37                 'ARM'         : 'arm32',
    38                 'arm32'       : 'arm32',
    39                 'ARM32'       : 'arm32',
     25                'x64'           : 'x64',
     26                'x86-64'        : 'x64',
     27                'x86_64'        : 'x64',
     28                'x86'           : 'x86',
     29                'aarch64'       : 'arm',
     30                'i386'          : 'x86',
     31                'i486'          : 'x86',
     32                'i686'          : 'x86',
     33                'Intel 80386'   : 'x86',
     34                'arm'           : 'arm',
     35                'ARM'           : 'arm',
    4036        }
    4137
    4238        CrossCompileFlags = {
    43                 'x64'  : 'ARCH_FLAGS=-m64',
    44                 'x86'  : 'ARCH_FLAGS=-m32',
    45                 'arm64': 'ARCH_FLAGS=',
    46                 'arm32': 'ARCH_FLAGS=',
     39                'x64' : 'ARCH_FLAGS=-m64',
     40                'x86' : 'ARCH_FLAGS=-m32',
    4741        }
    4842
     
    8377                        print("updated to %s" % self.target)
    8478
    85         def filter(self, tests):
    86                 return [test for test in tests if not test.arch or self.target == test.arch]
     79        def match(self, arch):
     80                return True if not arch else self.target == arch
    8781
    88         @staticmethod
    89         def make_canonical(arch):
     82        @classmethod
     83        def make_canonical(_, arch):
    9084                return Architecture.KnownArchitectures[arch]
    9185
     
    9690                self.flags  = """DEBUG_FLAGS=%s""" % ("-debug -O0" if value else "-nodebug -O2")
    9791                self.path   = "debug" if value else "nodebug"
    98 
    99 class AST:
    100         def __init__(self, ast):
    101                 if ast == "new":
    102                         self.target = ast
    103                         self.string = "New AST"
    104                         self.flags  = """AST_FLAGS=-XCFA,--new-ast"""
    105                 elif ast == "old":
    106                         self.target = ast
    107                         self.string = "Old AST"
    108                         self.flags  = """AST_FLAGS=-XCFA,--old-ast"""
    109                 elif ast == None:
    110                         self.target = "new" if config.NEWAST else "old"
    111                         self.string = "Default AST (%s)" % self.target
    112                         self.flags  = """AST_FLAGS="""
    113                 else:
    114                         print("""ERROR: Invalid ast configuration, must be "old", "new" or left unspecified, was %s""" % (value), file=sys.stderr)
    115                         sys.exit(1)
    116 
    117         def filter(self, tests):
    118 
    119                 return [test for test in tests if not test.astv or self.target == test.astv]
    12092
    12193class Install:
     
    132104                self.total  = Timeouts.check(tg)
    133105
    134         @staticmethod
    135         def check(value):
     106        @classmethod
     107        def check(_, value):
    136108                if value < 1:
    137109                        print("Timeouts must be at least 1 second", file=sys.stderr)
     
    141113
    142114def init( options ):
    143         global all_ast
    144         global all_arch
    145         global all_debug
    146         global all_install
    147         global ast
    148115        global arch
     116        global archive
    149117        global debug
    150         global archive
    151         global install
    152 
    153         global continue_
     118        global distcc
    154119        global dry_run
    155120        global generating
     121        global install
    156122        global make
    157123        global output_width
    158124        global timeout
    159         global timeout2gdb
    160125
    161         all_ast      = [AST(o)          for o in list(dict.fromkeys(options.ast    ))] if options.ast  else [AST(None)]
    162         all_arch     = [Architecture(o) for o in list(dict.fromkeys(options.arch   ))] if options.arch else [Architecture(None)]
    163         all_debug    = [Debug(o)        for o in list(dict.fromkeys(options.debug  ))]
    164         all_install  = [Install(o)      for o in list(dict.fromkeys(options.install))]
     126        arch         = Architecture(options.arch)
    165127        archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
    166         continue_    = options.continue_
     128        debug        = Debug(options.debug)
    167129        dry_run      = options.dry_run # must be called before tools.config_hash()
     130        distcc       = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash()
    168131        generating   = options.regenerate_expected
     132        install      = Install(options.install)
    169133        make         = ['make']
    170134        output_width = 24
    171135        timeout      = Timeouts(options.timeout, options.global_timeout)
    172         timeout2gdb  = options.timeout_with_gdb
    173136
    174137        # if we distribute, distcc errors will fail tests, use log file for distcc
     
    183146
    184147def validate():
    185         """Validate the current configuration and update globals"""
    186 
    187         global distcc
    188         distcc       = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash()
    189148        errf = os.path.join(BUILDDIR, ".validate.err")
    190149        make_ret, out = tools.make( ".validate", error_file = errf, output_file=subprocess.DEVNULL, error=subprocess.DEVNULL )
Note: See TracChangeset for help on using the changeset viewer.