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