Issue 1568: fix a stack trace when --debug=include tries to handle
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 17 Oct 2008 02:20:50 +0000 (02:20 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 17 Oct 2008 02:20:50 +0000 (02:20 +0000)
a library as an argument.

git-svn-id: http://scons.tigris.org/svn/scons/trunk@3694 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Node/__init__.py
test/option/debug-includes.py

index 8a16c8c8d729b8c23edf80ff0a26a89332acf474..4c89805cc35152c0ab416cdc54e2eb7db123397e 100644 (file)
@@ -24,6 +24,9 @@ RELEASE 1.X - XXX
     - Fix use of VariantDir when the -n option is used and doesn't,
       therefore, actually create the variant directory.
 
+    - Fix a stack trace from the --debug=includes option when passed a
+      static or shared library as an argument.
+
 
 
 RELEASE 1.1.0 - Thu, 09 Oct 2008 08:33:47 -0700
index 3a92b33c965bbd4d61d1666b0f64af287b96da37..871efff38ad6d86e2cc6158017b884fa2fab68be 100644 (file)
@@ -1104,7 +1104,10 @@ class Node:
             env = self.get_build_env()
             for s in self.sources:
                 scanner = self.get_source_scanner(s)
-                path = self.get_build_scanner_path(scanner)
+                if scanner:
+                    path = self.get_build_scanner_path(scanner)
+                else:
+                    path = None
                 def f(node, env=env, scanner=scanner, path=path):
                     return node.get_found_includes(env, scanner, path)
                 return SCons.Util.render_tree(s, f, 1)
index 70857e6637ac65dd68bc978a8a568e1da9a1efab..41e5a84217bcc6a751d9f9b2fe166a7c75cfb5a4 100644 (file)
@@ -38,8 +38,16 @@ import time
 test = TestSCons.TestSCons()
 
 test.write('SConstruct', """
-env = Environment(OBJSUFFIX = '.ooo', PROGSUFFIX = '.xxx')
-env.Program('foo', Split('foo.c bar.c'))
+env = Environment(OBJSUFFIX = '.obj',
+                  SHOBJSUFFIX = '.shobj',
+                  LIBPREFIX = '',
+                  LIBSUFFIX = '.lib',
+                  SHLIBPREFIX = '',
+                  SHLIBSUFFIX = '.shlib',
+                  )
+env.Program('foo.exe', ['foo.c', 'bar.c'])
+env.StaticLibrary('foo', ['foo.c', 'bar.c'])
+env.SharedLibrary('foo', ['foo.c', 'bar.c'])
 """)
 
 test.write('foo.c', r"""
@@ -78,7 +86,7 @@ includes = """
   +-foo.h
     +-bar.h
 """
-test.run(arguments = "--debug=includes foo.ooo")
+test.run(arguments = "--debug=includes foo.obj")
 
 if string.find(test.stdout(), includes) == -1:
     print "Did not find expected string in standard output."
@@ -88,6 +96,8 @@ if string.find(test.stdout(), includes) == -1:
     print test.stdout()
     test.fail_test()
 
+
+
 # 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
@@ -102,14 +112,20 @@ if string.find(test.stdout(), includes) == -1:
 #THIS SHOULD CAUSE A BUILD FAILURE
 #""")
 
-#test.run(arguments = "--debug=includes foo.xxx",
+#test.run(arguments = "--debug=includes foo.exe",
 #         status = 2,
 #         stderr = None)
 #test.fail_test(string.find(test.stdout(), includes) == -1)
 
+
+
 # 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")
+test.run(arguments = "--debug=includes foo.lib")
+test.run(arguments = "--debug=includes foo.shlib")
+
+
 
 test.pass_test()