[buildout]
develop = .
versions = versions
parts = test coverage-test coverage-report
        coverage-test-rl coverage-report-rl
        scripts python

[test]
recipe = zc.recipe.testrunner>=2.0
eggs = z3c.rml [test]

[coverage-test]
recipe = zc.recipe.testrunner
eggs = z3c.rml [test]
defaults = ['--tests-pattern', '^f?tests$$', '-vpc1']
initialization =
  # haaaaack because zc.testrunner 1.4.0 produces an _insane_ bin/test
  # that cannot be run with bin/coverage run bin/test, or even
  # bin/python bin/test
  import coverage, atexit, sys
  c = coverage.coverage(data_file='../../../.coverage',
                        branch=True,
                        cover_pylib=False,
                        source=['z3c.rml'])
  def _when_done(c=c): c.stop(), c.save()
  atexit.register(_when_done)
  if '--append-coverage' in sys.argv: sys.argv.remove('--append-coverage'), c.load()
  c.start()

[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coveragereport=coverage-report
arguments = sys.argv[1:] or [
     '--strip-prefix', os.path.realpath("src"),
     '${buildout:directory}/.coverage', '${buildout:directory}/coverage/report']

[coverage-test-rl]
recipe = zc.recipe.testrunner
eggs = z3c.rml [test]
defaults = ['--tests-pattern', '^f?tests$$', '-vpc1']
initialization =
  # haaaaack because zc.testrunner 1.4.0 produces an _insane_ bin/test
  # that cannot be run with bin/coverage run bin/test, or even
  # bin/python bin/test
  import coverage, atexit, sys
  c = coverage.coverage(data_file='../../../.coverage-rl',
                        branch=True,
                        cover_pylib=False,
                        source=['reportlab'])
  def _when_done(c=c): c.stop(), c.save()
  atexit.register(_when_done)
  if '--append-coverage' in sys.argv: sys.argv.remove('--append-coverage'), c.load()
  c.start()

[coverage-report-rl]
recipe = zc.recipe.egg
eggs = z3c.coverage
       z3c.rml
scripts = coveragereport=coverage-report-rl
arguments = sys.argv[1:] or [
     '--strip-prefix',
     os.path.split(os.path.dirname(__import__('reportlab').__file__))[0],
     '${buildout:directory}/.coverage-rl',
     '${buildout:directory}/coverage-rl/report']

[scripts]
recipe = zc.recipe.egg
eggs = z3c.rml [pagetemplate]

[python]
recipe = zc.recipe.egg
interpreter = python
eggs = z3c.rml [pagetemplate]

[ctags]
recipe = z3c.recipe.tag
eggs = ${test:eggs}

[versions]
reportlab = 2.6
Pillow = 1.7.8
lxml = 3.1.0
