Update of /cvsroot/cpptool/rfta/src/pyrfta/pytest
In directory sc8-pr-cvs1:/tmp/cvs-serv31156/src/pyrfta/pytest
Added Files:
alltests.py codeanalysis.py codeanalysistest.py
Log Message:
* converting the IdentifierResolver to python using the code model.
--- NEW FILE: alltests.py ---
#!/usr/bin/env python
#
# Example of assembling all available unit tests into one suite. This usually
# varies greatly from one project to the next, so the code shown below will not
# be incorporated into the 'unittest' module. Instead, modify it for your own
# purposes.
#
# $Id: alltests.py,v 1.1 2003/04/27 22:03:38 blep Exp $
import unittest
def suite():
modules_to_test = ('identifierresolvertest') # and so on
alltests = unittest.TestSuite()
for module in map(__import__, modules_to_test):
alltests.addTest(unittest.findTestCases(module))
return alltests
if __name__ == '__main__':
unittest.main(defaultTest='suite')
--- NEW FILE: codeanalysis.py ---
import pyrfta
class LocalVariableDeclarator(pyrfta.StatementVisitor):
def __init__( self, resolver ):
self.resolver = resolver
def declare(self, functionBody):
functionBody.accept(self)
def visitCompoundStatement(self,compound):
pass
class LocalVariableResolver:
def isLocaleVariable(self, variableName):
return false
def declareVariable(self, variableName):
pass
def enterScope(self):
pass
def exitScope(self):
pass
--- NEW FILE: codeanalysistest.py ---
import unittest
from codeanalysis import *
class IdentifierResolverTestCase(unittest.TestCase):
"""IdentifierResolver tests"""
def setUp(self):
pass
def tearDown(self):
pass
def testConstructor(self):
resolver = IdentifierResolver( None )
def suite():
return unittest.makeSuite(IdentifierResolverTestCase)
if __name__ == '__main__':
unittest.TextTestRunner().run(suite())
|