[tox]
envlist = py26,py27,pep8

[testenv]
setenv = LANG=en_US.UTF-8
         LANGUAGE=en_US:en
         LC_ALL=C
deps=
    testtools
    testrepository
    coverage
    babel
commands=
    bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
    bash -c 'testr run --parallel {posargs} ; RET=$? echo "Slowest Tests" ; testr slowest && exit $RET'

[testenv:py26]
deps=
    testtools
    testrepository
    coverage
    babel
    discover
    argparse

[pep8]
ignore = E125

[testenv:pep8]
deps = pep8
commands = 
    pep8 --repeat --show-source --exclude=.venv,.tox,doc .

[testenv:venv]
commands = {posargs}

[testenv:cover]
setenv = PYTHON=coverage run --source diskimage_builder
commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
           bash -c 'testr run --parallel ; RET=$? ; coverage combine ; coverage html -d ./cover $OMIT && exit $RET'

[tox:jenkins]
downloadcache = ~/cache/pip

[tox]
envlist = py26,py27,pep8

[testenv]
setenv = LANG=en_US.UTF-8
         LANGUAGE=en_US:en
         LC_ALL=C
deps=
    testtools
    testrepository
    coverage
    babel
commands=
    bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
    bash -c 'testr run --parallel {posargs} ; RET=$?; echo "Slowest Tests" ; testr slowest && exit $RET'

[testenv:py26]
deps=
    testtools
    testrepository
    coverage
    babel
    discover
    argparse

[pep8]
ignore = E125

[testenv:pep8]
deps = pep8
commands = 
    pep8 --repeat --show-source --exclude=.venv,.tox,doc .

[testenv:venv]
commands = {posargs}

[testenv:cover]
setenv = PYTHON=coverage run --source diskimage_builder
commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
           bash -c 'testr run --parallel ; RET=$? ; coverage combine ; coverage html -d ./cover $OMIT && exit $RET'

[tox:jenkins]
downloadcache = ~/cache/pip

Fix unit tests to have accurate return code.
Fix unit tests to have accurate return code.

Before 'tox -epy27' would not fail even if a unit test failed.

Change-Id: I3ed43fdd78d0d877b93b59e2eaaf5de289a17259
