CYAN_COLOR="\033[0;36;1m"
RESET_FORMAT="\033[0m"

test_integer_info () {
    echo "\n${CYAN_COLOR}info${RESET_FORMAT}: running tests with $1-bit test integers..."
}

export QUICKCHECK_TESTS=10000

run_test () {
    echo "using ${QUICKCHECK_TESTS} quickcheck tests per test"
    
    cargo test int --lib --quiet $2
    if [ $? -ne 0 ]
    then
        exit 1
    fi
}

for flags in "" "--all-features"
do
    echo "\n${CYAN_COLOR}info${RESET_FORMAT}: running tests with flags '$flags'..."
    for bits in 16 32 64 128
    do
        run_test $bits $flags
    done
done
