diff --git a/etgtools/extractors.py b/etgtools/extractors.py index a03daa0a..01ad692f 100644 --- a/etgtools/extractors.py +++ b/etgtools/extractors.py @@ -470,6 +470,9 @@ class ClassDef(BaseDef): if countNonDefaultArgs(item) != 0: # TODO: check overloads too continue + # Getters must not be static methods + if item.isStatic: + continue elif prefix == 'Set': prop.setter = item.name # Setters must be able to be called with 1 arg, ensure @@ -794,12 +797,13 @@ class ModuleDef(BaseDef): """ This class holds all the items that will be in the generated module """ - def __init__(self, package, module, name, docstring=''): + def __init__(self, package, module, name, docstring='', check4unittest=True): super(ModuleDef, self).__init__() self.package = package self.module = module self.name = name self.docstring = docstring + self.check4unittest = check4unittest self.headerCode = [] self.cppCode = [] self.initializerCode = [] diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index eaa4929b..2443e096 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -305,6 +305,8 @@ def getDocsGenerator(): def runGenerators(module): + checkForUnitTestModule(module) + # Create the code generator and make the wrapper code wg = getWrapperGenerator() wg.generate(module) @@ -314,6 +316,12 @@ def runGenerators(module): dg.generate(module) +def checkForUnitTestModule(module): + pathname = 'unittests/test_%s.py' % module.name + if os.path.exists(pathname) or not module.check4unittest: + return + print 'WARNING: Unittest module (%s) not found!' % pathname + #---------------------------------------------------------------------------