Changeset afe8882 for tests/pybin/settings.py
- Timestamp:
- Aug 15, 2018, 3:51:12 PM (5 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- bdff89d
- Parents:
- 7bd4cc9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/settings.py
r7bd4cc9 rafe8882 6 6 7 7 try : 8 sys.path.append(os.getcwd()) 8 testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0]))) 9 sys.path.append(testpath) 9 10 import config 10 11 11 12 SRCDIR = os.path.abspath(config.SRCDIR) 12 13 BUILDDIR = os.path.abspath(config.BUILDDIR) 14 os.chdir(testpath) 15 13 16 except: 14 17 print('ERROR: missing config.py, re-run configure script.', file=sys.stderr) … … 88 91 self.flags = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree") 89 92 93 class Timeouts: 94 def __init__(self, ts, tg): 95 self.single = Timeouts.check(ts) 96 self.total = Timeouts.check(tg) 97 98 @classmethod 99 def check(_, value): 100 if value < 1: 101 print("Timeouts must be at least 1 second", file=sys.stderr) 102 sys.exit(1) 103 104 return value 105 90 106 def init( options ): 91 107 global arch … … 95 111 global debug 96 112 global install 113 global timeout 97 114 98 115 dry_run = options.dry_run … … 102 119 install = Install(options.install) 103 120 arch = Architecture(options.arch) 121 timeout = Timeouts(options.timeout, options.global_timeout) 104 122 105 123 … … 110 128 111 129 def validate(): 112 make_ret, _ = tools.make( ".validate", error_file = ".validate.err", redirects = "2> /dev/null 1> /dev/null", ) 130 errf = os.path.join(BUILDDIR, ".validate.err") 131 make_ret, _ = tools.make( ".validate", error_file = errf, redirects = "2> /dev/null 1> /dev/null", ) 113 132 if make_ret != 0: 114 with open ( ".validate.err", "r") as myfile:133 with open (errf, "r") as myfile: 115 134 error=myfile.read() 116 135 print("ERROR: Invalid configuration %s:%s" % (arch.string, debug.string), file=sys.stderr) 117 136 print(" verify returned : \n%s" % error, file=sys.stderr) 118 tools.rm( "%s/.validate.err" % BUILDDIR)137 tools.rm(errf) 119 138 sys.exit(1) 120 139 121 tools.rm( "%s/.validate.err" % BUILDDIR)140 tools.rm(errf)
Note: See TracChangeset
for help on using the changeset viewer.