summaryrefslogtreecommitdiffstats
path: root/test/option--debug.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-12-03 16:06:04 (GMT)
committerSteven Knight <knight@baldmt.com>2004-12-03 16:06:04 (GMT)
commit5330322296bac696af8793287fdbbecc6f755062 (patch)
treefe59fb9ac580b7b454482d93d0389cd0f00f12fc /test/option--debug.py
parent2c53df0afd0836bb17b6214c290d30f8d2f80ffd (diff)
downloadSCons-5330322296bac696af8793287fdbbecc6f755062.zip
SCons-5330322296bac696af8793287fdbbecc6f755062.tar.gz
SCons-5330322296bac696af8793287fdbbecc6f755062.tar.bz2
Print --debug={tree,dtree,includes} even if the build has an error.
Diffstat (limited to 'test/option--debug.py')
-rw-r--r--test/option--debug.py45
1 files changed, 41 insertions, 4 deletions
diff --git a/test/option--debug.py b/test/option--debug.py
index 47bc058..f0114e5 100644
--- a/test/option--debug.py
+++ b/test/option--debug.py
@@ -126,24 +126,61 @@ test.fail_test(string.find(test.stdout(), stree2) == -1)
-tree = """
+dtree = """
+-foo.xxx
+-foo.ooo
+-bar.ooo
"""
test.run(arguments = "--debug=dtree foo.xxx")
-test.fail_test(string.find(test.stdout(), tree) == -1)
+test.fail_test(string.find(test.stdout(), dtree) == -1)
-tree = """
+includes = """
+-foo.c
+-foo.h
+-bar.h
"""
test.run(arguments = "--debug=includes foo.ooo")
+test.fail_test(string.find(test.stdout(), includes) == -1)
+
+# Make sure we print the debug stuff even if there's a build failure.
+test.write('bar.h', """
+#ifndef BAR_H
+#define BAR_H
+#include "foo.h"
+#endif
+THIS SHOULD CAUSE A BUILD FAILURE
+""")
+
+test.run(arguments = "--debug=tree foo.xxx",
+ status = 2,
+ stderr = None)
test.fail_test(string.find(test.stdout(), tree) == -1)
-# these shouldn't print out anything in particular, but
+test.run(arguments = "--debug=dtree foo.xxx",
+ status = 2,
+ stderr = None)
+test.fail_test(string.find(test.stdout(), dtree) == -1)
+
+# In an ideal world, --debug=includes would also work when there's a build
+# failure, but this would require even more complicated logic to scan
+# all of the intermediate nodes that get skipped when the build failure
+# occurs. On the YAGNI theory, we're just not going to worry about this
+# until it becomes an issue that someone actually cares enough about.
+#test.run(arguments = "--debug=includes foo.xxx",
+# status = 2,
+# stderr = None)
+#test.fail_test(string.find(test.stdout(), includes) == -1)
+
+# Restore bar.h to something good.
+test.write('bar.h', """
+#ifndef BAR_H
+#define BAR_H
+#include "foo.h"
+#endif
+""")
+
+# These shouldn't print out anything in particular, but
# they shouldn't crash either:
test.run(arguments = "--debug=includes .")
test.run(arguments = "--debug=includes foo.c")