#!/bin/sh -ex

if [ -d reproducer_ve ]; then
	rm -r reproducer_ve
fi

virtualenv reproducer_ve
. reproducer_ve/bin/activate

pip install coverage

cat > foo.py <<EOF

def bar(a, b):
	if a < 0:
		return a + b
	return a - b

EOF

cat > test_foo.py <<EOF
from foo import bar
from unittest import TestCase


class FooTests(TestCase):
	def test_bar(self):
		bar(1, 2)
EOF

coverage run -m unittest test_foo
coverage html
xdg-open htmlcov/index.html
