diff options
author | Steven Knight <knight@baldmt.com> | 2002-06-05 23:35:56 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-06-05 23:35:56 (GMT) |
commit | 2f7d4f660fd048edc342a989d25c94d7b52ab13e (patch) | |
tree | 20def5c6f0f7b68ab7151cac4ada5c470a3b31e0 /src/engine/SCons/Scanner | |
parent | 42717c855f7cbb73d3017ac243a34491d3cc0c53 (diff) | |
download | SCons-2f7d4f660fd048edc342a989d25c94d7b52ab13e.zip SCons-2f7d4f660fd048edc342a989d25c94d7b52ab13e.tar.gz SCons-2f7d4f660fd048edc342a989d25c94d7b52ab13e.tar.bz2 |
Changes from Charles Crain.
Diffstat (limited to 'src/engine/SCons/Scanner')
-rw-r--r-- | src/engine/SCons/Scanner/C.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/CTests.py | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/engine/SCons/Scanner/C.py b/src/engine/SCons/Scanner/C.py index c81417a..77b9525 100644 --- a/src/engine/SCons/Scanner/C.py +++ b/src/engine/SCons/Scanner/C.py @@ -38,6 +38,7 @@ import SCons.Node import SCons.Node.FS import SCons.Scanner import SCons.Util +import SCons.Warnings include_re = re.compile('^[ \t]*#[ \t]*include[ \t]+(<|")([\\w./\\\\]+)(>|")', re.M) @@ -114,6 +115,9 @@ def scan(node, env, target, fs = SCons.Node.FS.default_fs): if not n is None: nodes.append(n) + else: + SCons.Warnings.warn(SCons.Warnings.DependencyWarning, + "No dependency generated for file: %s (included from: %s) -- file not found" % (include[1], node)) node.found_includes[cpppath] = nodes # Schwartzian transform from the Python FAQ Wizard diff --git a/src/engine/SCons/Scanner/CTests.py b/src/engine/SCons/Scanner/CTests.py index f99af18..cc9e116 100644 --- a/src/engine/SCons/Scanner/CTests.py +++ b/src/engine/SCons/Scanner/CTests.py @@ -30,6 +30,7 @@ import sys import os import os.path import SCons.Node.FS +import SCons.Warnings test = TestCmd.TestCmd(workdir = '') @@ -230,11 +231,23 @@ class CScannerTestCase8(unittest.TestCase): class CScannerTestCase9(unittest.TestCase): def runTest(self): + SCons.Warnings.enableWarningClass(SCons.Warnings.DependencyWarning) + class TestOut: + def __call__(self, x): + self.out = x + + to = TestOut() + to.out = None + SCons.Warnings._warningOut = to test.write('fa.h','\n') fs = SCons.Node.FS.FS(test.workpath('')) s = SCons.Scanner.C.CScan(fs=fs) env = DummyEnvironment([]) deps = s.scan(fs.File('fa.cpp'), env, DummyTarget()) + + # Did we catch the warning associated with not finding fb.h? + assert to.out + deps_match(self, deps, [ 'fa.h' ]) test.unlink('fa.h') |