summaryrefslogtreecommitdiffstats
path: root/runtest.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2006-02-17 11:13:44 (GMT)
committerSteven Knight <knight@baldmt.com>2006-02-17 11:13:44 (GMT)
commitc65d4516ce3791463d7fcdd3b62e034d1d0b59be (patch)
tree5aa3861e45ae88203f5e07c35a8cd84ec9cefaa8 /runtest.py
parenta51746d0720fb854faa776704112b9f30b86764b (diff)
downloadSCons-c65d4516ce3791463d7fcdd3b62e034d1d0b59be.zip
SCons-c65d4516ce3791463d7fcdd3b62e034d1d0b59be.tar.gz
SCons-c65d4516ce3791463d7fcdd3b62e034d1d0b59be.tar.bz2
Add a --verbose option to runtest.py. (Baptiste Lepilleur) Fix (?) a deadlock using the --xml option on Windows.
Diffstat (limited to 'runtest.py')
-rw-r--r--runtest.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/runtest.py b/runtest.py
index e96ed83..1530415 100644
--- a/runtest.py
+++ b/runtest.py
@@ -140,6 +140,9 @@ Options:
-q, --quiet Don't print the test being executed.
-t, --time Print test execution time.
-v version Specify the SCons version.
+ --verbose=LEVEL Set verbose level: 1 = print executed commands,
+ 2 = print commands and non-zero output,
+ 3 = print commands and all output.
-X Test script is executable, don't feed to Python.
-x SCRIPT, --exec SCRIPT Test SCRIPT.
--xml Print results in SCons XML format.
@@ -150,7 +153,7 @@ opts, args = getopt.getopt(sys.argv[1:], "adf:ho:P:p:qv:Xx:t",
'debug', 'file=', 'help', 'output=',
'package=', 'passed', 'python=', 'quiet',
'version=', 'exec=', 'time',
- 'xml'])
+ 'verbose=', 'xml'])
for o, a in opts:
if o == '-a' or o == '--all':
@@ -178,6 +181,8 @@ for o, a in opts:
printcommand = 0
elif o == '-t' or o == '--time':
print_time = lambda fmt, time: sys.stdout.write(fmt % time)
+ elif o in ['--verbose']:
+ os.environ['TESTCMD_VERBOSE'] = a
elif o == '-v' or o == '--version':
version = a
elif o == '-X':
@@ -235,7 +240,8 @@ except AttributeError:
return status >> 8
else:
def spawn_it(command_args):
- command_args = map(escape, command_args)
+ command_args = map(escape, command_args)
+ command_args = map(lambda s: string.replace(s, '\\','\\\\'), command_args)
return os.spawnv(os.P_WAIT, command_args[0], command_args)
class Base:
@@ -264,8 +270,8 @@ except AttributeError:
def execute(self):
(tochild, fromchild, childerr) = os.popen3(self.command_str)
tochild.close()
- self.stdout = fromchild.read()
self.stderr = childerr.read()
+ self.stdout = fromchild.read()
fromchild.close()
self.status = childerr.close()
if not self.status: