Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # This script sets up the LNT test-suite environment |
| 4 | # Use *only* on an empty dir, as it will destroy any data |
| 5 | |
| 6 | set -e |
| 7 | |
| 8 | echo "Checking for python 2.7..." |
| 9 | python=`which python2.7` |
| 10 | |
| 11 | rm -rf sandbox |
| 12 | |
| 13 | gitupdate() { |
| 14 | repo=$1 |
| 15 | git -C $repo checkout master |
| 16 | git -C $repo fetch |
| 17 | git -C $repo pull |
| 18 | } |
| 19 | |
| 20 | echo "Checking out LNT/test-suite repositories..." |
| 21 | if [ ! -e lnt ]; then |
| 22 | git clone http://llvm.org/git/lnt.git |
| 23 | fi |
| 24 | gitupdate lnt |
| 25 | if [ ! -e test-suite ]; then |
| 26 | git clone http://llvm.org/git/test-suite.git |
| 27 | fi |
| 28 | gitupdate test-suite |
| 29 | |
| 30 | echo "Installing Python deps..." |
| 31 | sudo pip install virtualenv |
| 32 | |
| 33 | echo "Setting up the sandbox..." |
| 34 | virtualenv --python=$python sandbox |
| 35 | ./sandbox/bin/python ./lnt/setup.py develop |
| 36 | |
| 37 | echo "All done. Use run.sh to run your test(s)" |