diff options
| author | Steven Knight <knight@baldmt.com> | 2002-10-19 06:36:57 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2002-10-19 06:36:57 (GMT) |
| commit | 276f24218f1e730fed31fa9f9072cdd464adb7b3 (patch) | |
| tree | 278e8603a6c798f3ecb244d75105da3ab3449825 /src/engine/SCons/Node | |
| parent | 24f95ab2762edefba6fc7afd3a302c2d2d69c5e1 (diff) | |
| download | SCons-276f24218f1e730fed31fa9f9072cdd464adb7b3.zip SCons-276f24218f1e730fed31fa9f9072cdd464adb7b3.tar.gz SCons-276f24218f1e730fed31fa9f9072cdd464adb7b3.tar.bz2 | |
Fixes for tests following the Repository/BuildDir refactoring. (Charles Crain).
Diffstat (limited to 'src/engine/SCons/Node')
| -rw-r--r-- | src/engine/SCons/Node/FS.py | 7 | ||||
| -rw-r--r-- | src/engine/SCons/Node/FSTests.py | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index aa6482d..fac9627 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -688,6 +688,13 @@ class Dir(Entry): self._sconsign = SCons.Sig.SConsignFile(self) return self._sconsign + def srcnode(self): + """Dir has a special need for srcnode()...if we + have a srcdir attribute set, then that *is* our srcnode.""" + if self.srcdir: + return self.srcdir + return Entry.srcnode(self) + # XXX TODO? # base_suf # suffix diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 1610ec6..8f9f5e4 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -82,15 +82,19 @@ class BuildDirTestCase(unittest.TestCase): f1 = fs.File('build/test1') fs.BuildDir('build', 'src') f2 = fs.File('build/test2') + d1 = fs.Dir('build') assert f1.srcnode().path == os.path.normpath('src/test1'), f1.srcnode().path assert f2.srcnode().path == os.path.normpath('src/test2'), f2.srcnode().path + assert d1.srcnode().path == 'src', d1.srcnode().path fs = SCons.Node.FS.FS() f1 = fs.File('build/test1') fs.BuildDir('build', '.') f2 = fs.File('build/test2') + d1 = fs.Dir('build') assert f1.srcnode().path == 'test1', f1.srcnode().path assert f2.srcnode().path == 'test2', f2.srcnode().path + assert d1.srcnode().path == '.', d1.srcnode().path fs = SCons.Node.FS.FS() fs.BuildDir('build/var1', 'src') |
