Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    ra45fc7b r8bdc1c36  
     1from __future__ import print_function
     2
    13import os
    2 import subprocess
    34import sys
    4 from . import tools
     5import tools
    56
    67try :
     
    3839        def __init__(self, arch):
    3940                try:
    40                         canonical_host = Architecture.make_canonical( config.HOSTARCH )
     41                        canonical_host = Architecture.makeCanonical( config.HOSTARCH )
    4142                except KeyError:
    4243                        print("Unkown host architecture %s" % config.HOSTARCH, file=sys.stderr)
     
    4546                if arch:
    4647                        try:
    47                                 arch = Architecture.make_canonical( arch )
     48                                arch = Architecture.makeCanonical( arch )
    4849                        except KeyError:
    4950                                print("Unkown architecture %s" % arch, file=sys.stderr)
     
    7677
    7778        @classmethod
    78         def make_canonical(_, arch):
     79        def makeCanonical(_, arch):
    7980                return Architecture.KnownArchitectures[arch]
    8081
     
    8384        def __init__(self, value):
    8485                self.string = "debug" if value else "no debug"
    85                 self.flags  = """DEBUG_FLAGS=%s""" % ("-debug -O0" if value else "-nodebug -O2")
     86                self.flags  = """DEBUG_FLAGS="%s" """ % ("-debug -O0" if value else "-nodebug -O2")
    8687
    8788class Install:
    8889        def __init__(self, value):
    8990                self.string = "installed" if value else "in-tree"
    90                 self.flags  = """INSTALL_FLAGS=%s""" % ("" if value else "-in-tree")
     91                self.flags  = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree")
    9192
    9293class Timeouts:
     
    111112        global install
    112113        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)
    122         output_width = 24
     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)
    123122
    124123
    125 def update_make_cmd(force, jobs):
     124def updateMakeCmd(force, jobs):
    126125        global make
    127126
    128         make = ['make'] if not force else ['make', "-j%i" % jobs]
     127        make = "make" if not force else ("make -j%i" % jobs)
    129128
    130129def validate():
    131130        errf = os.path.join(BUILDDIR, ".validate.err")
    132         make_ret, out = tools.make( ".validate", error_file = errf, output=subprocess.DEVNULL, error=subprocess.DEVNULL )
     131        make_ret, _ = tools.make( ".validate", error_file = errf, redirects  = "2> /dev/null 1> /dev/null", )
    133132        if make_ret != 0:
    134133                with open (errf, "r") as myfile:
     
    140139
    141140        tools.rm(errf)
    142 
    143 def 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.