Changes in tests/pybin/settings.py [a2f2fda:abec2f8]
- File:
-
- 1 edited
-
tests/pybin/settings.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/settings.py
ra2f2fda rabec2f8 23 23 class Architecture: 24 24 KnownArchitectures = { 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', 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', 40 36 } 41 37 42 38 CrossCompileFlags = { 43 'x64' : 'ARCH_FLAGS=-m64', 44 'x86' : 'ARCH_FLAGS=-m32', 45 'arm64': 'ARCH_FLAGS=', 46 'arm32': 'ARCH_FLAGS=', 39 'x64' : 'ARCH_FLAGS=-m64', 40 'x86' : 'ARCH_FLAGS=-m32', 47 41 } 48 42 … … 83 77 print("updated to %s" % self.target) 84 78 85 def filter(self, tests):86 return [test for test in tests if not test.arch or self.target == test.arch]79 def match(self, arch): 80 return True if not arch else self.target == arch 87 81 88 @ staticmethod89 def make_canonical( arch):82 @classmethod 83 def make_canonical(_, arch): 90 84 return Architecture.KnownArchitectures[arch] 91 85 … … 96 90 self.flags = """DEBUG_FLAGS=%s""" % ("-debug -O0" if value else "-nodebug -O2") 97 91 self.path = "debug" if value else "nodebug" 98 99 class AST:100 def __init__(self, ast):101 if ast == "new":102 self.target = ast103 self.string = "New AST"104 self.flags = """AST_FLAGS=-XCFA,--new-ast"""105 elif ast == "old":106 self.target = ast107 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.target112 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 92 121 93 class Install: … … 132 104 self.total = Timeouts.check(tg) 133 105 134 @ staticmethod135 def check( value):106 @classmethod 107 def check(_, value): 136 108 if value < 1: 137 109 print("Timeouts must be at least 1 second", file=sys.stderr) … … 141 113 142 114 def init( options ): 143 global all_ast144 global all_arch145 global all_debug146 global all_install147 global ast148 115 global arch 116 global archive 149 117 global debug 150 global archive 151 global install 152 153 global continue_ 118 global distcc 154 119 global dry_run 155 120 global generating 121 global install 156 122 global make 157 123 global output_width 158 124 global timeout 159 global timeout2gdb160 125 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))] 126 arch = Architecture(options.arch) 165 127 archive = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None 166 continue_ = options.continue_128 debug = Debug(options.debug) 167 129 dry_run = options.dry_run # must be called before tools.config_hash() 130 distcc = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash() 168 131 generating = options.regenerate_expected 132 install = Install(options.install) 169 133 make = ['make'] 170 134 output_width = 24 171 135 timeout = Timeouts(options.timeout, options.global_timeout) 172 timeout2gdb = options.timeout_with_gdb173 136 174 137 # if we distribute, distcc errors will fail tests, use log file for distcc … … 183 146 184 147 def validate(): 185 """Validate the current configuration and update globals"""186 187 global distcc188 distcc = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash()189 148 errf = os.path.join(BUILDDIR, ".validate.err") 190 149 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.