-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.sh
executable file
·30 lines (25 loc) · 1.06 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
##### if we do not run this script inside a container, we create a temporary container to run this script ####
if [ ! -f /.dockerinit ]; then
echo -------------------------------------[launching container]----
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
docker run --rm -v $DIR:/test -ti -w "/test" ubuntu:14.04 /bin/bash -c './run_tests.sh;/bin/bash'
echo -------------------------------------[exiting container]----
exit
fi
########## code to start testing
if [ ! -f /tmp/runtests ]; then
apt-get update
apt-get -y install curl python
curl -s https://bootstrap.pypa.io/get-pip.py | python -
pip install -r requirements.txt
pip install coverage pytest
touch /tmp/runtests
fi
python setup.py test