2 ##############################################################################
3 # Copyright (c) 2016 Dan Radez (Red Hat)
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 # Make sure python dependencies are installed
14 for pkg in epel-release python34-devel python34-nose; do
15 if ! rpm -q ${pkg} > /dev/null; then
16 if ! sudo yum install -y ${pkg}; then
17 echo "Failed to install ${pkg} package..."
23 # Make sure coverage is installed
24 if ! python3 -c "import coverage" &> /dev/null; then sudo easy_install-3.4 coverage; fi
26 pushd ../build/ > /dev/null
29 pushd ../tests/ > /dev/null
30 percent=$(coverage3 report --include '*lib/python/*' -m | grep TOTAL | tr -s ' ' | awk '{ print $4 }' | cut -d % -f 1)
31 if [[ percent -lt 80 ]]; then
32 echo "Python Coverage: $percent"
33 echo "Does not meet 80% requirement"