summaryrefslogtreecommitdiffstats
path: root/test/option--debug.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-09-18 12:41:15 (GMT)
committerSteven Knight <knight@baldmt.com>2004-09-18 12:41:15 (GMT)
commit56f6ebd377b893efa78130cc49db48675e48439e (patch)
treea6471aa2c86cfe1d44b297e29d7df306152b477d /test/option--debug.py
parent797e94a2484a11a771fb537619bdc011bf94bf2d (diff)
downloadSCons-56f6ebd377b893efa78130cc49db48675e48439e.zip
SCons-56f6ebd377b893efa78130cc49db48675e48439e.tar.gz
SCons-56f6ebd377b893efa78130cc49db48675e48439e.tar.bz2
Print tracebacks for errors other than UserError and StopError. (Gary Oberbrunner)
Diffstat (limited to 'test/option--debug.py')
-rw-r--r--test/option--debug.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/option--debug.py b/test/option--debug.py
index 64cc424..e3d9960 100644
--- a/test/option--debug.py
+++ b/test/option--debug.py
@@ -384,4 +384,49 @@ test.must_match('file16.out', "file16.in\n")
test.must_match('file17.out', "file17.in\n")
test.must_match('file18.out', "file18.in\n")
+############################
+# test --debug=stacktrace
+
+test.write('SConstruct', """\
+def kfile_scan(node, env, target):
+ raise "kfile_scan error"
+
+kscan = Scanner(name = 'kfile',
+ function = kfile_scan,
+ skeys = ['.k'])
+
+env = Environment()
+env.Append(SCANNERS = [kscan])
+
+env.Command('foo', 'foo.k', Copy('$TARGET', '$SOURCE'))
+""")
+
+test.write('foo.k', "foo.k\n")
+
+test.run(status = 2, stderr = "scons: *** kfile_scan error\n")
+
+test.run(arguments = "--debug=stacktrace",
+ status = 2,
+ stderr = None)
+
+stderr = test.stderr()
+
+lines = [
+ "scons: *** kfile_scan error",
+ "scons: internal stack trace:",
+ 'raise "kfile_scan error"',
+]
+
+missing = []
+for line in lines:
+ if string.find(stderr, line) == -1:
+ missing.append(line)
+
+if missing:
+ print "STDERR is missing the following lines:"
+ print "\t" + string.join(lines, "\n\t")
+ print "STDERR ====="
+ print stderr
+ test.fail_test(1)
+
test.pass_test()