assert str(f) == os.path.join('sub', 'file')
assert not f.exists()
+class stored_infoTestCase(unittest.TestCase):
+ def runTest(self):
+ """Test how storing build information"""
+ test = TestCmd(workdir = '')
+ test.subdir('sub')
+ fs = SCons.Node.FS.FS(test.workpath(''))
+
+ d = fs.Dir('sub')
+ f = fs.File('file1', d)
+ bi = f.get_stored_info()
+ assert bi.bsig == None, bi.bsig
+
+ class MySConsign:
+ class Null:
+ def __init__(self):
+ self.xyzzy = 7
+ def get_entry(self, name):
+ return self.Null()
+
+ f = fs.File('file2', d)
+ f.dir.sconsign = MySConsign
+ bi = f.get_stored_info()
+ assert bi.xyzzy == 7, bi
+
class has_src_builderTestCase(unittest.TestCase):
def runTest(self):
"""Test the has_src_builder() method"""
suite.addTest(RepositoryTestCase())
suite.addTest(find_fileTestCase())
suite.addTest(StringDirTestCase())
+ suite.addTest(stored_infoTestCase())
suite.addTest(has_src_builderTestCase())
suite.addTest(prepareTestCase())
suite.addTest(get_actionsTestCase())
result = node.explain()
assert result == None, result
+ class Null_BInfo:
+ def __init__(self):
+ pass
+
+ node.get_stored_info = Null_BInfo
+ node.__str__ = lambda: 'null_binfo'
+ result = node.explain()
+ assert result == "Cannot explain why `null_binfo' is being rebuilt: No previous build information found\n", result
+
# XXX additional tests for the guts of the functionality some day
def test_del_binfo(self):
node.csig = None
node.bsig = None
+class SConsignEntryTestCase(unittest.TestCase):
+
+ def runTest(self):
+
+ se = SCons.Sig.SConsignEntry()
+ assert hasattr(se, 'timestamp'), "no timestamp attribute"
+ assert hasattr(se, 'bsig'), "no bsig attribute"
+ assert hasattr(se, 'csig'), "no csig attribute"
+ assert hasattr(se, 'implicit'), "no implicit attribute"
+
class SigTestBase:
def runTest(self):
def suite():
suite = unittest.TestSuite()
+ suite.addTest(SConsignEntryTestCase())
suite.addTest(MD5TestCase())
suite.addTest(TimeStampTestCase())
suite.addTest(CalcTestCase())