Changes in tests/pybin/settings.py [afe8882:47c1928]
- File:
-
- 1 edited
-
tests/pybin/settings.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/pybin/settings.py
rafe8882 r47c1928 6 6 7 7 try : 8 testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0]))) 9 sys.path.append(testpath) 8 sys.path.append(os.getcwd()) 10 9 import config 11 10 12 11 SRCDIR = os.path.abspath(config.SRCDIR) 13 12 BUILDDIR = os.path.abspath(config.BUILDDIR) 14 os.chdir(testpath)15 16 13 except: 17 14 print('ERROR: missing config.py, re-run configure script.', file=sys.stderr) … … 91 88 self.flags = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree") 92 89 93 class Timeouts:94 def __init__(self, ts, tg):95 self.single = Timeouts.check(ts)96 self.total = Timeouts.check(tg)97 98 @classmethod99 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 value105 106 90 def init( options ): 107 91 global arch … … 111 95 global debug 112 96 global install 113 global timeout114 97 115 98 dry_run = options.dry_run … … 119 102 install = Install(options.install) 120 103 arch = Architecture(options.arch) 121 timeout = Timeouts(options.timeout, options.global_timeout)122 104 123 105 … … 128 110 129 111 def validate(): 130 errf = os.path.join(BUILDDIR, ".validate.err") 131 make_ret, _ = tools.make( ".validate", error_file = errf, redirects = "2> /dev/null 1> /dev/null", ) 112 make_ret, _ = tools.make( ".validate", error_file = ".validate.err", redirects = "2> /dev/null 1> /dev/null", ) 132 113 if make_ret != 0: 133 with open ( errf, "r") as myfile:114 with open (".validate.err", "r") as myfile: 134 115 error=myfile.read() 135 116 print("ERROR: Invalid configuration %s:%s" % (arch.string, debug.string), file=sys.stderr) 136 117 print(" verify returned : \n%s" % error, file=sys.stderr) 137 tools.rm( errf)118 tools.rm("%s/.validate.err" % BUILDDIR) 138 119 sys.exit(1) 139 120 140 tools.rm( errf)121 tools.rm("%s/.validate.err" % BUILDDIR)
Note:
See TracChangeset
for help on using the changeset viewer.