mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 21:10:06 +01:00
* Don't generate the property if the getter is static
* Give a WARNING if there is no unittest file for the etg file. This can be suppressed for the modules that really do not need one. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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 = []
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user