diff options
author | Steven Knight <knight@baldmt.com> | 2003-10-04 13:37:54 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-10-04 13:37:54 (GMT) |
commit | db545f30d242352f96dfea29d0f9ca9ba39ab72b (patch) | |
tree | af529c0527702746d5b82df8d95f001133eb2401 /src/engine/SCons/Scanner | |
parent | 176114b2c141bd950c2bc7231f829989fc7481b1 (diff) | |
download | SCons-db545f30d242352f96dfea29d0f9ca9ba39ab72b.zip SCons-db545f30d242352f96dfea29d0f9ca9ba39ab72b.tar.gz SCons-db545f30d242352f96dfea29d0f9ca9ba39ab72b.tar.bz2 |
Add .S, .spp and .SPP to the list of files scanned for C preprocessor dependencies. (J.T. Conklin)
Diffstat (limited to 'src/engine/SCons/Scanner')
-rw-r--r-- | src/engine/SCons/Scanner/C.py | 3 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/CTests.py | 21 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/engine/SCons/Scanner/C.py b/src/engine/SCons/Scanner/C.py index c78fa4b..4fcf327 100644 --- a/src/engine/SCons/Scanner/C.py +++ b/src/engine/SCons/Scanner/C.py @@ -38,7 +38,8 @@ def CScan(fs = SCons.Node.FS.default_fs): cs = SCons.Scanner.ClassicCPP("CScan", [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", - ".F", ".fpp", ".FPP"], + ".F", ".fpp", ".FPP", + ".S", ".spp", ".SPP"], "CPPPATH", '^[ \t]*#[ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")', fs = fs) diff --git a/src/engine/SCons/Scanner/CTests.py b/src/engine/SCons/Scanner/CTests.py index 3a5d308..253af88 100644 --- a/src/engine/SCons/Scanner/CTests.py +++ b/src/engine/SCons/Scanner/CTests.py @@ -194,13 +194,13 @@ class DummyEnvironment: def __delitem__(self,key): del self.Dictionary()[key] -global my_normpath -my_normpath = os.path.normpath if os.path.normcase('foo') == os.path.normcase('FOO'): - global my_normpath my_normpath = os.path.normcase +else: + my_normpath = os.path.normpath def deps_match(self, deps, headers): + global my_normpath scanned = map(my_normpath, map(str, deps)) expect = map(my_normpath, headers) self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned)) @@ -393,7 +393,19 @@ class CScannerTestCase14(unittest.TestCase): deps = s(make_node('f5.c'), env, path) headers = ['f5a.h', 'f5b.h'] deps_match(self, deps, map(test.workpath, headers)) - + +class CScannerTestCase15(unittest.TestCase): + def runTest(self): + env = DummyEnvironment([]) + s = SCons.Scanner.C.CScan() + suffixes = [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", + ".h", ".H", ".hxx", ".hpp", ".hh", + ".F", ".fpp", ".FPP", + ".S", ".spp", ".SPP"] + for suffix in suffixes: + assert suffix in s.skeys, "%s not in skeys" % suffix + + def suite(): suite = unittest.TestSuite() @@ -410,6 +422,7 @@ def suite(): suite.addTest(CScannerTestCase12()) suite.addTest(CScannerTestCase13()) suite.addTest(CScannerTestCase14()) + suite.addTest(CScannerTestCase15()) return suite if __name__ == "__main__": |