diff options
author | Steven Knight <knight@baldmt.com> | 2003-03-22 08:31:26 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-03-22 08:31:26 (GMT) |
commit | 3be8585d1be52d25020b93d99c333d9c9d577b51 (patch) | |
tree | 1841b7b005e680ba16d9a897e759774390a1583c /src/engine/SCons/Node/FSTests.py | |
parent | 5ea9b7416ae70c3a4678bcf337bebd41b944cf86 (diff) | |
download | SCons-3be8585d1be52d25020b93d99c333d9c9d577b51.zip SCons-3be8585d1be52d25020b93d99c333d9c9d577b51.tar.gz SCons-3be8585d1be52d25020b93d99c333d9c9d577b51.tar.bz2 |
Make RCS/SCCS/BitKeeper support more transparent.
Diffstat (limited to 'src/engine/SCons/Node/FSTests.py')
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 294a4bb..d460c1e 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -1182,47 +1182,46 @@ class StringDirTestCase(unittest.TestCase): assert str(f) == os.path.join('sub', 'file') assert not f.exists() -class has_builderTestCase(unittest.TestCase): +class has_src_builderTestCase(unittest.TestCase): def runTest(self): - """Test the has_builder() method""" + """Test the has_src_builder() method""" test = TestCmd(workdir = '') fs = SCons.Node.FS.FS(test.workpath('')) os.chdir(test.workpath('')) - test.subdir('sub') - - d = fs.Dir('sub', '.') - f1 = fs.File('f1', d) - f2 = fs.File('f2', d) - f3 = fs.File('f3', d) - f4 = fs.File('f4', d) - f5 = fs.File('f5', d) - f6 = fs.File('f6', d) - f7 = fs.File('f7', d) - - h = f1.has_builder() + test.subdir('sub1') + test.subdir('sub2', ['sub2', 'SCCS'], ['sub2', 'RCS']) + + sub1 = fs.Dir('sub1', '.') + f1 = fs.File('f1', sub1) + f2 = fs.File('f2', sub1) + f3 = fs.File('f3', sub1) + sub2 = fs.Dir('sub2', '.') + f4 = fs.File('f4', sub2) + f5 = fs.File('f5', sub2) + f6 = fs.File('f6', sub2) + + h = f1.has_src_builder() assert not h, h b1 = Builder(fs.File) - d.set_src_builder(b1) + sub1.set_src_builder(b1) - test.write(['sub', 'f2'], "sub/f2\n") - h = f1.has_builder() # cached from previous has_builder() call + test.write(['sub1', 'f2'], "sub1/f2\n") + h = f1.has_src_builder() # cached from previous call assert not h, h - h = f2.has_builder() + h = f2.has_src_builder() assert not h, h - h = f3.has_builder() + h = f3.has_src_builder() assert h, h assert f3.builder is b1, f3.builder - test.write(['sub', 'f4'], "sub/f4\n") - test.write(['sub', 'f6'], "sub/f6\n") - h = f4.has_builder(fetch = 0) + test.write(['sub2', 'SCCS', 's.f5'], "sub2/SCCS/s.f5\n") + test.write(['sub2', 'RCS', 'f6,v'], "sub2/RCS/f6,v\n") + h = f4.has_src_builder() assert not h, h - h = f5.has_builder(fetch = 0) - assert not h, h - h = f6.has_builder(fetch = 1) - assert not h, h - h = f7.has_builder(fetch = 1) + h = f5.has_src_builder() + assert h, h + h = f6.has_src_builder() assert h, h class prepareTestCase(unittest.TestCase): @@ -1267,13 +1266,13 @@ class get_actionsTestCase(unittest.TestCase): a = dir.get_actions() assert a == [], a -class SConstructTestCase(unittest.TestCase): +class SConstruct_dirTestCase(unittest.TestCase): def runTest(self): - """Test setting the SConstruct file""" + """Test setting the SConstruct directory""" fs = SCons.Node.FS.FS() - fs.set_SConstruct('xxx') - assert fs.SConstruct.path == 'xxx' + fs.set_SConstruct_dir(fs.Dir('xxx')) + assert fs.SConstruct_dir.path == 'xxx' class CacheDirTestCase(unittest.TestCase): def runTest(self): @@ -1437,10 +1436,10 @@ if __name__ == "__main__": suite.addTest(RepositoryTestCase()) suite.addTest(find_fileTestCase()) suite.addTest(StringDirTestCase()) - suite.addTest(has_builderTestCase()) + suite.addTest(has_src_builderTestCase()) suite.addTest(prepareTestCase()) suite.addTest(get_actionsTestCase()) - suite.addTest(SConstructTestCase()) + suite.addTest(SConstruct_dirTestCase()) suite.addTest(CacheDirTestCase()) if not unittest.TextTestRunner().run(suite).wasSuccessful(): sys.exit(1) |