comparison test.py @ 1:43ec211e2c59

Started the development of 1.21.0 Portability: '.' -> os.curdir.
author Oleg Oshmyan <chortos@inbox.lv>
date Fri, 22 Jan 2010 19:27:20 +0000
parents b9622c1e2197
children bddcc05aba59
comparison
equal deleted inserted replaced
0:b9622c1e2197 1:43ec211e2c59
17 del parser 17 del parser
18 18
19 globals1 = set(globals()) 19 globals1 = set(globals())
20 20
21 # Initialize some configuration variables with default values 21 # Initialize some configuration variables with default values
22 tasknames = ('.',) 22 tasknames = (os.curdir,)
23 maxtime = 0 23 maxtime = 0
24 tests = () 24 tests = ()
25 dummies = () 25 dummies = ()
26 testsexcluded = () 26 testsexcluded = ()
27 padwithzeroestolength = 0 27 padwithzeroestolength = 0
374 def chdir_and_exec_testconf(): 374 def chdir_and_exec_testconf():
375 global cwd 375 global cwd
376 cwd = '' 376 cwd = ''
377 if os.path.isdir(taskname): 377 if os.path.isdir(taskname):
378 os.chdir(taskname) 378 os.chdir(taskname)
379 if taskname != '.': 379 if taskname != :
380 cwd = taskname + '/' 380 cwd = taskname + '/'
381 try: 381 try:
382 execfile('testconf.py', globals()) 382 execfile('testconf.py', globals())
383 return 383 return
384 except IOError: 384 except IOError:
427 427
428 try: 428 try:
429 if len(tasknames) > 1: 429 if len(tasknames) > 1:
430 print taskname 430 print taskname
431 except Exception: 431 except Exception:
432 if taskname != '.' or ntasks: 432 if taskname != os.curdir or ntasks:
433 print taskname 433 print taskname
434 434
435 try: del inname 435 try: del inname
436 except NameError: pass 436 except NameError: pass
437 try: del outname 437 try: del outname
438 except NameError: pass 438 except NameError: pass
439 try: del ansname 439 try: del ansname
440 except NameError: pass 440 except NameError: pass
441 441
442 if not namedefined and taskname != '.': 442 if not namedefined and taskname != os.curdir:
443 name = './' + taskname 443 name = os.path + os.sep + taskname
444 for k in shared: 444 for k in shared:
445 g[k] = shared[k] 445 g[k] = shared[k]
446 446
447 oldcwd = os.getcwdu() 447 oldcwd = os.getcwdu()
448 chdir_and_exec_testconf() 448 chdir_and_exec_testconf()