Ignore:
Timestamp:
May 24, 2019, 10:19:41 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d908563
Parents:
6a9d4b4 (diff), 292642a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    r6a9d4b4 r933f32f  
    1 from __future__ import print_function
    2 
    31import os
     2import subprocess
    43import sys
    5 import tools
     4from . import tools
    65
    76try :
     
    3938        def __init__(self, arch):
    4039                try:
    41                         canonical_host = Architecture.makeCanonical( config.HOSTARCH )
     40                        canonical_host = Architecture.make_canonical( config.HOSTARCH )
    4241                except KeyError:
    4342                        print("Unkown host architecture %s" % config.HOSTARCH, file=sys.stderr)
     
    4645                if arch:
    4746                        try:
    48                                 arch = Architecture.makeCanonical( arch )
     47                                arch = Architecture.make_canonical( arch )
    4948                        except KeyError:
    5049                                print("Unkown architecture %s" % arch, file=sys.stderr)
     
    7776
    7877        @classmethod
    79         def makeCanonical(_, arch):
     78        def make_canonical(_, arch):
    8079                return Architecture.KnownArchitectures[arch]
    8180
     
    8483        def __init__(self, value):
    8584                self.string = "debug" if value else "no debug"
    86                 self.flags  = """DEBUG_FLAGS="%s" """ % ("-debug -O0" if value else "-nodebug -O2")
     85                self.flags  = """DEBUG_FLAGS=%s""" % ("-debug -O0" if value else "-nodebug -O2")
    8786
    8887class Install:
    8988        def __init__(self, value):
    9089                self.string = "installed" if value else "in-tree"
    91                 self.flags  = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree")
     90                self.flags  = """INSTALL_FLAGS=%s""" % ("" if value else "-in-tree")
    9291
    9392class Timeouts:
     
    112111        global install
    113112        global timeout
     113        global output_width
    114114
    115         dry_run    = options.dry_run
    116         generating = options.regenerate_expected
    117         make       = 'make'
    118         debug        = Debug(options.debug)
    119         install    = Install(options.install)
    120         arch       = Architecture(options.arch)
    121         timeout    = Timeouts(options.timeout, options.global_timeout)
     115        dry_run      = options.dry_run
     116        generating   = options.regenerate_expected
     117        make         = ['make']
     118        debug        = Debug(options.debug)
     119        install      = Install(options.install)
     120        arch         = Architecture(options.arch)
     121        timeout      = Timeouts(options.timeout, options.global_timeout)
     122        output_width = 24
    122123
    123124
    124 def updateMakeCmd(force, jobs):
     125def update_make_cmd(force, jobs):
    125126        global make
    126127
    127         make = "make" if not force else ("make -j%i" % jobs)
     128        make = ['make'] if not force else ['make', "-j%i" % jobs]
    128129
    129130def validate():
    130131        errf = os.path.join(BUILDDIR, ".validate.err")
    131         make_ret, _ = tools.make( ".validate", error_file = errf, redirects  = "2> /dev/null 1> /dev/null", )
     132        make_ret, out = tools.make( ".validate", error_file = errf, output=subprocess.DEVNULL, error=subprocess.DEVNULL )
    132133        if make_ret != 0:
    133134                with open (errf, "r") as myfile:
     
    139140
    140141        tools.rm(errf)
     142
     143def prep_output(tests):
     144        global output_width
     145        output_width = max(map(lambda t: len(t.target()), tests))
Note: See TracChangeset for help on using the changeset viewer.