#!/bin/bash
#
# Copyright 2014-2018 Facundo Batista, Nicolás Demarchi

set -eu

if [ $# -ne 0 ]; then
    TARGET_TESTS="$@"
else
    TARGET_TESTS="fades tests"
fi

FADES='./bin/fades -r requirements.txt'

$FADES -x nosetests --with-xcoverage --cover-package=fades -v -s $TARGET_TESTS

# check if we are using exit() in the code.
if grep -r -n ' exit(' --include="*.py" .; then echo 'Please use sys.exit() instead of exit(). https://github.com/PyAr/fades/issues/280'; fi
