Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    rabec2f8 ra2f2fda  
    2323class Architecture:
    2424        KnownArchitectures = {
    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',
     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',
    3640        }
    3741
    3842        CrossCompileFlags = {
    39                 'x64' : 'ARCH_FLAGS=-m64',
    40                 'x86' : 'ARCH_FLAGS=-m32',
     43                'x64'  : 'ARCH_FLAGS=-m64',
     44                'x86'  : 'ARCH_FLAGS=-m32',
     45                'arm64': 'ARCH_FLAGS=',
     46                'arm32': 'ARCH_FLAGS=',
    4147        }
    4248
     
    7783                        print("updated to %s" % self.target)
    7884
    79         def match(self, arch):
    80                 return True if not arch else self.target == arch
    81 
    82         @classmethod
    83         def make_canonical(_, arch):
     85        def filter(self, tests):
     86                return [test for test in tests if not test.arch or self.target == test.arch]
     87
     88        @staticmethod
     89        def make_canonical(arch):
    8490                return Architecture.KnownArchitectures[arch]
    8591
     
    9197                self.path   = "debug" if value else "nodebug"
    9298
     99class 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]
     120
    93121class Install:
    94122        def __init__(self, value):
     
    104132                self.total  = Timeouts.check(tg)
    105133
    106         @classmethod
    107         def check(_, value):
     134        @staticmethod
     135        def check(value):
    108136                if value < 1:
    109137                        print("Timeouts must be at least 1 second", file=sys.stderr)
     
    113141
    114142def init( options ):
     143        global all_ast
     144        global all_arch
     145        global all_debug
     146        global all_install
     147        global ast
    115148        global arch
     149        global debug
    116150        global archive
    117         global debug
    118         global distcc
     151        global install
     152
     153        global continue_
    119154        global dry_run
    120155        global generating
    121         global install
    122156        global make
    123157        global output_width
    124158        global timeout
    125 
    126         arch         = Architecture(options.arch)
     159        global timeout2gdb
     160
     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))]
    127165        archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
    128         debug        = Debug(options.debug)
     166        continue_    = options.continue_
    129167        dry_run      = options.dry_run # must be called before tools.config_hash()
    130         distcc       = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash()
    131168        generating   = options.regenerate_expected
    132         install      = Install(options.install)
    133169        make         = ['make']
    134170        output_width = 24
    135171        timeout      = Timeouts(options.timeout, options.global_timeout)
     172        timeout2gdb  = options.timeout_with_gdb
    136173
    137174        # if we distribute, distcc errors will fail tests, use log file for distcc
     
    146183
    147184def validate():
     185        """Validate the current configuration and update globals"""
     186
     187        global distcc
     188        distcc       = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash()
    148189        errf = os.path.join(BUILDDIR, ".validate.err")
    149190        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.