Support #include with no spaces before the opening quote or angle bracket.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 29 Aug 2003 04:37:18 +0000 (04:37 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 29 Aug 2003 04:37:18 +0000 (04:37 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@782 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Scanner/C.py
src/engine/SCons/Scanner/CTests.py

index 61cdb4426117acfe9d223278af3e7816a0b5ab6e..0b1b03ed8ec5c4f3ca8648e78cdd125757129109 100644 (file)
@@ -25,6 +25,9 @@ RELEASE X.XX - XXX
   - The -Q option suppressed too many messages; fix it so that it only
     suppresses the Reading/Building messages.
 
+  - Support #include when there's no space before the opening quote
+    or angle bracket.
+
 
 
 RELEASE 0.92 - Wed, 20 Aug 2003 03:45:28 -0500
index 44007f9f90420d779ab64bf2c33f585acff4f573..c78fa4b598bbd32a9f6eaf887fcbc9e28487cbef 100644 (file)
@@ -40,6 +40,6 @@ def CScan(fs = SCons.Node.FS.default_fs):
                                    ".h", ".H", ".hxx", ".hpp", ".hh",
                                    ".F", ".fpp", ".FPP"],
                                   "CPPPATH",
-                                  '^[ \t]*#[ \t]*(?:include|import)[ \t]+(<|")([^>"]+)(>|")',
+                                  '^[ \t]*#[ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")',
                                   fs = fs)
     return cs
index 907ad64ffe7b3189dcca9260bb3f232c9c1ca6e9..3a5d3082e7985ba52dc8f47d9cf2c3ef31ba5678 100644 (file)
@@ -157,6 +157,14 @@ int main()
 
 test.write([ 'repository', 'src', 'ddd.h'], "\n")
 
+test.write('f5.c', """\
+#include\"f5a.h\"
+#include<f5b.h>
+""")
+
+test.write("f5a.h", "\n")
+test.write("f5b.h", "\n")
+
 # define some helpers:
 
 class DummyEnvironment:
@@ -376,6 +384,15 @@ class CScannerTestCase13(unittest.TestCase):
         deps = s(make_node('f1.cpp'), env, path)
         headers = ['d1/f2.h', 'f1.h']
         deps_match(self, deps, map(test.workpath, headers))
+
+class CScannerTestCase14(unittest.TestCase):
+    def runTest(self):
+        env = DummyEnvironment([])
+        s = SCons.Scanner.C.CScan()
+        path = s.path(env)
+        deps = s(make_node('f5.c'), env, path)
+        headers = ['f5a.h', 'f5b.h']
+        deps_match(self, deps, map(test.workpath, headers))
         
 
 def suite():
@@ -392,6 +409,7 @@ def suite():
     suite.addTest(CScannerTestCase11())
     suite.addTest(CScannerTestCase12())
     suite.addTest(CScannerTestCase13())
+    suite.addTest(CScannerTestCase14())
     return suite
 
 if __name__ == "__main__":