3e538ffb702b5cbbb3c68bdb35c7f6c04adde147
[apex.git] / ci / test.sh
1 #!/bin/sh
2 ##############################################################################
3 # Copyright (c) 2016 Dan Radez (Red Hat)
4 #
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 ##############################################################################
10
11 set -e
12
13 # Make sure python dependencies are installed
14 for pkg in iproute epel-release python34-devel python34-nose python34-PyYAML python-pep8 python34-mock; do
15   if ! rpm -q ${pkg} > /dev/null; then
16     if ! sudo yum install -y ${pkg}; then
17       echo "Failed to install ${pkg} package..."
18       exit 1
19     fi
20   fi
21 done
22
23 # Make sure coverage is installed
24 if ! python3 -c "import coverage" &> /dev/null; then sudo easy_install-3.4 coverage; fi
25
26 pushd ../build/ > /dev/null
27 make python-tests
28 make python-pep8-check
29 popd > /dev/null