# wendelin.core | tox setup
[tox]
envlist = py27-{ZODB4,ZODB5}-{zblk0,zblk1}-{fs,zeo,neo}-{numpy115,numpy116}-{!wcfs,wcfs,wcfs:1,wcfs:2},
          {py36,py37}-{ZODB4,ZODB5}-{zblk0,zblk1}-fs-{numpy115,numpy116}-{!wcfs,wcfs,wcfs:1,wcfs:2},
          py36-{ZODB4,ZODB5}-{zblk0,zblk1}-zeo-{numpy115,numpy116}-{!wcfs,wcfs,wcfs:1,wcfs:2},
          py37-ZODB5-{zblk0,zblk1}-zeo-{numpy115,numpy116-{!wcfs,wcfs,wcfs:1,wcfs:2}}
# (NOTE ZEO4 does not work with python3.7)
# (NOTE NEO does not work on python3 at all)
# (XXX ZODB5-*-neo are currently failing)

[testenv]
deps    =
    .[test]

    # latest current ZODB _4_
    ZODB4:  ZODB >=4.0, <5.0dev
    ZODB4:  ZEO  >=4.0, <5.0dev

    # latest current ZODB 5
    ZODB5:  ZODB >=5.0,	<6.0dev
    ZODB5:  ZEO	 >=5.0, <6.0dev
    # ZODB/test/util depends on mock starting from ZODB 5.5
    ZODB5:  mock

    neo:    neoppod >= 1.12
    # neo.tests also imports MySQLdb unconditionally
    neo:    mysqlclient


    # zeo: ZEO is already required by ZODB, but for testing utilities from ZEO we also need:
    zeo:    zope.testing

    numpy116: numpy >=1.16.0, <1.17.0
    numpy115: numpy >=1.15.0, <1.16.0

setenv =
    fs:  WENDELIN_CORE_TEST_DB=<fs>
    zeo: WENDELIN_CORE_TEST_DB=<zeo>
    neo: WENDELIN_CORE_TEST_DB=<neo>

    zblk0:  WENDELIN_CORE_ZBLK_FMT=ZBlk0
    zblk1:  WENDELIN_CORE_ZBLK_FMT=ZBlk1

    !wcfs:  WENDELIN_CORE_VIRTMEM=rw:uvmm
    wcfs:   WENDELIN_CORE_VIRTMEM=r:wcfs+w:uvmm

    # some bugs are only likely to trigger when there is only 1 main OS thread in wcfs
    wcfs:1: WENDELIN_CORE_VIRTMEM=r:wcfs+w:uvmm
    wcfs:1: GOMAXPROCS=1

    # ----//---- 2 main OS threads in wcfs
    wcfs:2: WENDELIN_CORE_VIRTMEM=r:wcfs+w:uvmm
    wcfs:2: GOMAXPROCS=2

commands= {envpython} setup.py test
# XXX setenv = TMPDIR = ... ?  (so that /tmp is not on tmpfs and we don't run out of memory on bench)
# + {envpython} setup.py bench  (?)
