summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FSTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-12-31 02:51:50 (GMT)
committerSteven Knight <knight@baldmt.com>2001-12-31 02:51:50 (GMT)
commit74bc0282241e4d35b225660fe783955629ed234a (patch)
treecf4b0175cee4670e6b366e7a4c2218dc3bce508f /src/engine/SCons/Node/FSTests.py
parent19ece17e5e025b7b9278a846eea60c8d12be438a (diff)
downloadSCons-74bc0282241e4d35b225660fe783955629ed234a.zip
SCons-74bc0282241e4d35b225660fe783955629ed234a.tar.gz
SCons-74bc0282241e4d35b225660fe783955629ed234a.tar.bz2
General performance tweaks
Diffstat (limited to 'src/engine/SCons/Node/FSTests.py')
-rw-r--r--src/engine/SCons/Node/FSTests.py53
1 files changed, 2 insertions, 51 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 4801dae..c9d17a7 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -48,8 +48,8 @@ class Scanner:
global scanner_count
scanner_count = scanner_count + 1
self.hash = scanner_count
- def scan(self, filename, env):
- return [SCons.Node.FS.default_fs.File(filename)]
+ def scan(self, node, env):
+ return [node]
def __hash__(self):
return self.hash
@@ -393,56 +393,7 @@ class FSTestCase(unittest.TestCase):
f1.build()
assert f1.dir.exists()
- # Test comparison of FS objects
- fs1 = SCons.Node.FS.FS()
- fs2 = SCons.Node.FS.FS()
os.chdir('..')
- fs3 = SCons.Node.FS.FS()
- assert fs1 == fs2
- assert fs1 != fs3
-
- # Test comparison of Entry objects
- e1 = fs3.Entry('cmp/entry')
- e2 = fs3.Entry('cmp/../cmp/entry')
- e3 = fs3.Entry('entry')
- assert e1 == e2
- assert e1 != e3
- assert e1 == os.path.normpath("cmp/entry"), e1
- assert e1 != os.path.normpath("c/entry"), e1
-
- # Test comparison of Dir objects
- d1 = fs3.Dir('cmp/dir')
- d2 = fs3.Dir('cmp/../cmp/dir')
- d3 = fs3.Dir('dir')
- assert d1 == d2
- assert d1 != d3
- assert d1 == os.path.normpath("cmp/dir"), d1
- assert d1 != os.path.normpath("c/dir"), d1
-
- # Test comparison of File objects
- f1 = fs3.File('cmp/file')
- f2 = fs3.File('cmp/../cmp/file')
- f3 = fs3.File('file')
- assert f1 == f2
- assert f1 != f3
- assert f1 == os.path.normpath("cmp/file"), f1
- assert f1 != os.path.normpath("c/file"), f1
-
- # Test comparison of different type objects
- f1 = fs1.File('cmp/xxx')
- d2 = fs2.Dir('cmp/xxx')
- assert f1 != d2, "%s == %s" % (f1.__class__, d2.__class__)
-
- # Test hashing FS nodes
- f = fs1.File('hash/f')
- d = fs1.Dir('hash/d')
- e = fs1.Entry('hash/e')
- val = {}
- val[f] = 'f'
- val[d] = 'd'
- val[e] = 'e'
- for k, v in val.items():
- assert k == os.path.normpath("hash/" + v)
# Test getcwd()
fs = SCons.Node.FS.FS()