Changeset 136f86b for tests/pybin


Ignore:
Timestamp:
Mar 27, 2020, 11:45:09 AM (19 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
68887f9
Parents:
2980667
Message:

Test script can now run multiple configuration in a row

Location:
tests/pybin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    r2980667 r136f86b  
    7777                        print("updated to %s" % self.target)
    7878
    79         def match(self, arch):
     79        def filter(self, tests):
     80                return [test for test in tests if not test.arch or self.target == test.arch]
    8081                return True if not arch else self.target == arch
    8182
     
    113114
    114115def init( options ):
     116        global all_arch
     117        global all_debug
     118        global all_install
    115119        global arch
    116120        global archive
     121        global continue_
    117122        global debug
    118         global distcc
    119123        global dry_run
    120124        global generating
     
    125129        global timeout2gdb
    126130
    127         arch         = Architecture(options.arch)
     131        all_arch     = [Architecture(o) for o in list(dict.fromkeys(options.arch   ))]
     132        all_debug    = [Debug(o)        for o in list(dict.fromkeys(options.debug  ))]
     133        all_install  = [Install(o)      for o in list(dict.fromkeys(options.install))]
    128134        archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
    129         debug        = Debug(options.debug)
     135        continue_    = options.continue_
    130136        dry_run      = options.dry_run # must be called before tools.config_hash()
    131         distcc       = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash()
    132137        generating   = options.regenerate_expected
    133         install      = Install(options.install)
    134138        make         = ['make']
    135139        output_width = 24
     
    148152
    149153def validate():
     154        """Validate the current configuration and update globals"""
     155
     156        global distcc
     157        distcc       = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash()
    150158        errf = os.path.join(BUILDDIR, ".validate.err")
    151159        make_ret, out = tools.make( ".validate", error_file = errf, output_file=subprocess.DEVNULL, error=subprocess.DEVNULL )
  • tests/pybin/tools.py

    r2980667 r136f86b  
    327327        raise argparse.ArgumentTypeError(msg)
    328328
     329# Convert a function that converts a string to one that converts comma separated string.
     330def comma_separated(elements):
     331    return lambda string: [elements(part) for part in string.split(',')]
     332
    329333def fancy_print(text):
    330334        column = which('column')
Note: See TracChangeset for help on using the changeset viewer.