Changeset 4a60488 for tests/pybin/settings.py
- Timestamp:
- Sep 27, 2019, 3:35:46 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 90ce35aa
- Parents:
- 8e1467d (diff), 849720f (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/settings.py
r8e1467d r4a60488 4 4 from . import tools 5 5 6 global original_path 7 6 8 try : 9 original_path = os.getcwd() 7 10 testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0]))) 8 11 sys.path.append(testpath) … … 11 14 SRCDIR = os.path.abspath(config.SRCDIR) 12 15 BUILDDIR = os.path.abspath(config.BUILDDIR) 16 distribute = config.DISTRIBUTE 13 17 os.chdir(testpath) 14 18 … … 19 23 class Architecture: 20 24 KnownArchitectures = { 21 'x64' : 'x64', 22 'x86-64' : 'x64', 23 'x86_64' : 'x64', 24 'x86' : 'x86', 25 'x64' : 'x64', 26 'x86-64' : 'x64', 27 'x86_64' : 'x64', 28 'x86' : 'x86', 29 'aarch64' : 'arm', 25 30 'i386' : 'x86', 26 31 'i486' : 'x86', 27 32 'i686' : 'x86', 28 33 'Intel 80386' : 'x86', 29 'arm' 30 'ARM' 34 'arm' : 'arm', 35 'ARM' : 'arm', 31 36 } 32 37 … … 40 45 canonical_host = Architecture.make_canonical( config.HOSTARCH ) 41 46 except KeyError: 42 print("Unk own host architecture %s" % config.HOSTARCH, file=sys.stderr)47 print("Unknown host architecture %s" % config.HOSTARCH, file=sys.stderr) 43 48 sys.exit(1) 44 49 … … 47 52 arch = Architecture.make_canonical( arch ) 48 53 except KeyError: 49 print("Unk own architecture %s" % arch, file=sys.stderr)54 print("Unknown architecture %s" % arch, file=sys.stderr) 50 55 sys.exit(1) 51 56 … … 84 89 self.string = "debug" if value else "no debug" 85 90 self.flags = """DEBUG_FLAGS=%s""" % ("-debug -O0" if value else "-nodebug -O2") 91 self.path = "debug" if value else "nodebug" 86 92 87 93 class Install: 88 94 def __init__(self, value): 89 self.string = "installed" if value else "in-tree" 90 self.flags = """INSTALL_FLAGS=%s""" % ("" if value else "-in-tree") 95 if value: 96 distribute = False 97 98 self.string = "installed" if value else "in tree" 99 self.flags = """installed=%s""" % ("yes" if value else "no") 91 100 92 101 class Timeouts: … … 105 114 def init( options ): 106 115 global arch 116 global archive 117 global debug 118 global distcc 107 119 global dry_run 108 120 global generating 121 global install 109 122 global make 110 global debug 111 global install 123 global output_width 112 124 global timeout 113 global output_width114 125 115 dry_run = options.dry_run 126 arch = Architecture(options.arch) 127 archive = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None 128 debug = Debug(options.debug) 129 dry_run = options.dry_run # must be called before tools.config_hash() 130 distcc = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash() 116 131 generating = options.regenerate_expected 132 install = Install(options.install) 117 133 make = ['make'] 118 debug = Debug(options.debug) 119 install = Install(options.install) 120 arch = Architecture(options.arch) 134 output_width = 24 121 135 timeout = Timeouts(options.timeout, options.global_timeout) 122 output_width = 24123 136 137 # if we distribute, distcc errors will fail tests, use log file for distcc 138 # don't use "'DISTCC_LOG' not in os.environ" because it can be set to '' 139 if distribute and not os.environ.get('DISTCC_LOG'): 140 os.putenv('DISTCC_LOG', os.path.join(BUILDDIR, 'distcc_error.log')) 124 141 125 142 def update_make_cmd(force, jobs): … … 130 147 def validate(): 131 148 errf = os.path.join(BUILDDIR, ".validate.err") 132 make_ret, out = tools.make( ".validate", error_file = errf, output =subprocess.DEVNULL, error=subprocess.DEVNULL )149 make_ret, out = tools.make( ".validate", error_file = errf, output_file=subprocess.DEVNULL, error=subprocess.DEVNULL ) 133 150 if make_ret != 0: 134 151 with open (errf, "r") as myfile:
Note:
See TracChangeset
for help on using the changeset viewer.