test.py: minor fixes and changes
This commit is contained in:
parent
0a7d08258b
commit
41da65ddcc
2 changed files with 8 additions and 6 deletions
10
test/test.py
10
test/test.py
|
|
@ -684,14 +684,15 @@ class TestSuiteRunner(object):
|
|||
cmd_disp = ' '.join(qargs).replace('\\','/') # for mingw
|
||||
|
||||
if not no_msg:
|
||||
t_fmt = f'{time.time() - self.start_time:08.2f}'
|
||||
if opt.verbose or opt.print_cmdline or opt.exact_output:
|
||||
clr1,clr2 = ((green,cyan),(nocolor,nocolor))[bool(opt.print_cmdline)]
|
||||
omsg(green('Testing: {}'.format(desc)))
|
||||
omsg(green(f'[{t_fmt}] Testing: {desc}'))
|
||||
if not msg_only:
|
||||
s = repr(cmd_disp) if g.platform == 'win' else cmd_disp
|
||||
omsg(clr1('Executing: ') + clr2(s))
|
||||
else:
|
||||
omsg_r('Testing {}: '.format(desc))
|
||||
omsg_r(f'[{t_fmt}] Testing {desc}: ')
|
||||
|
||||
if msg_only:
|
||||
return
|
||||
|
|
@ -709,7 +710,7 @@ class TestSuiteRunner(object):
|
|||
return MMGenPexpect(args,no_output=no_output)
|
||||
|
||||
def end_msg(self):
|
||||
t = int(time.time()) - self.start_time
|
||||
t = int(time.time() - self.start_time)
|
||||
m = '{} test{} performed. Elapsed time: {:02d}:{:02d}\n'
|
||||
sys.stderr.write(green(m.format(self.cmd_total,suf(self.cmd_total),t//60,t%60)))
|
||||
|
||||
|
|
@ -765,7 +766,7 @@ class TestSuiteRunner(object):
|
|||
return True
|
||||
|
||||
def run_tests(self,usr_args):
|
||||
self.start_time = int(time.time())
|
||||
self.start_time = time.time()
|
||||
gname_save = None
|
||||
if usr_args:
|
||||
for arg in usr_args:
|
||||
|
|
@ -894,6 +895,7 @@ class TestSuiteRunner(object):
|
|||
|
||||
if opt.profile: start = time.time()
|
||||
|
||||
self.ts.test_name = cmd # NB: Do not remove, this needs to set twice
|
||||
cdata = self.gm.dpy_data[cmd]
|
||||
# self.ts.test_dpydata = cdata
|
||||
self.ts.tmpdir_num = cdata[0]
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ def restore_debug():
|
|||
for k in save_debug:
|
||||
os.environ[k] = save_debug[k] or ''
|
||||
|
||||
def get_file_with_ext(tdir,ext,delete=True,no_dot=False,return_list=False,delete_all=False):
|
||||
def get_file_with_ext(tdir,ext,delete=True,no_dot=False,return_list=False,delete_all=False,quiet=False):
|
||||
|
||||
dot = ('.','')[bool(no_dot)]
|
||||
flist = [os.path.join(tdir,f) for f in os.listdir(tdir) if f == ext or f[-len(dot+ext):] == dot+ext]
|
||||
|
|
@ -106,7 +106,7 @@ def get_file_with_ext(tdir,ext,delete=True,no_dot=False,return_list=False,delete
|
|||
|
||||
if len(flist) > 1 or delete_all:
|
||||
if delete or delete_all:
|
||||
if not opt.quiet:
|
||||
if not (quiet or opt.quiet):
|
||||
msg("Multiple *.{} files in '{}' - deleting".format(ext,tdir))
|
||||
for f in flist:
|
||||
os.unlink(f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue