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 is installed
14 if ! rpm -q python34-devel > /dev/null; then
15 sudo yum install -y epel-release
16 if ! sudo yum install -y python34-devel; then
17 echo "Failed to install python34-devel package..."
22 # Make sure coverage is installed
23 if ! python3 -c "import coverage" &> /dev/null; then sudo easy_install-3.4 coverage; fi
26 pushd ../tests/ > /dev/null
27 percent=$(coverage3 report --include '*lib/python/*' -m | grep TOTAL | tr -s ' ' | awk '{ print $4 }' | cut -d % -f 1)
28 if [[ percent -lt 80 ]]; then
29 echo "Python Coverage: $percent"
30 echo "Does not meet 80% requirement"