2009-06-29 07:06:01 -05:00
|
|
|
<!codeHeader!>
|
2009-12-03 09:45:05 -06:00
|
|
|
# Test coverage-related stuff --------------------------------------------------
|
|
|
|
import sys
|
2011-12-05 08:11:29 -06:00
|
|
|
from appy.gen.mixins.TestMixin import TestMixin
|
2009-12-03 09:45:05 -06:00
|
|
|
covFolder = TestMixin.getCovFolder()
|
|
|
|
# The previous method checks in sys.argv whether Zope was lauched for performing
|
|
|
|
# coverage tests or not.
|
|
|
|
cov = None # The main Coverage instance as created by the coverage program.
|
|
|
|
totalNumberOfTests = <!totalNumberOfTests!>
|
|
|
|
numberOfExecutedTests = 0
|
|
|
|
if covFolder:
|
|
|
|
try:
|
|
|
|
import coverage
|
|
|
|
from coverage import coverage
|
|
|
|
cov = coverage()
|
|
|
|
cov.start()
|
|
|
|
except ImportError:
|
2013-05-29 17:46:11 -05:00
|
|
|
print('COVERAGE KO! The "coverage" program is not installed. You can ' \
|
2009-12-03 09:45:05 -06:00
|
|
|
'download it from http://nedbatchelder.com/code/coverage.' \
|
2013-05-29 17:46:11 -05:00
|
|
|
'\nHit <enter> to execute the test suite without coverage.')
|
2009-12-03 09:45:05 -06:00
|
|
|
sys.stdin.readline()
|
|
|
|
|
|
|
|
def countTest():
|
|
|
|
global numberOfExecutedTests
|
|
|
|
numberOfExecutedTests += 1
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
2010-09-02 09:16:08 -05:00
|
|
|
import config
|
2011-12-05 08:11:29 -06:00
|
|
|
from appy.gen.installer import ZopeInstaller
|
2009-06-29 07:06:01 -05:00
|
|
|
|
2009-12-03 09:45:05 -06:00
|
|
|
# Zope-level installation of the generated product. ----------------------------
|
2009-06-29 07:06:01 -05:00
|
|
|
def initialize(context):
|
|
|
|
<!imports!>
|
|
|
|
# I need to do those imports here; else, types and add permissions will not
|
|
|
|
# be registered.
|
2010-08-05 11:23:17 -05:00
|
|
|
classes = [<!classes!>]
|
2011-11-25 11:01:20 -06:00
|
|
|
ZopeInstaller(context, config, classes).install()
|
2009-12-03 09:45:05 -06:00
|
|
|
# ------------------------------------------------------------------------------
|