1 | #!/bin/bash
|
2 |
|
3 |
|
4 | hash /usr/bin/env phantomjs &> /dev/null
|
5 | if [ $? -eq 1 ]; then
|
6 | echo "ERROR: phantomjs is not installed"
|
7 | echo "Please visit http://www.phantomjs.org/"
|
8 | exit 1
|
9 | fi
|
10 |
|
11 |
|
12 | if [ $# -lt 1 ]
|
13 | then
|
14 | echo "Usage: `basename $0` path_to_runner.html"
|
15 | echo
|
16 | exit 1
|
17 | fi
|
18 |
|
19 | SCRIPTDIR=$(dirname `perl -e 'use Cwd "abs_path";print abs_path(shift)' $0`)
|
20 | TESTFILE=""
|
21 | while (( "$#" )); do
|
22 | if [ ${1:0:7} == "http://" -o ${1:0:8} == "https://" ]; then
|
23 | TESTFILE="$TESTFILE $1"
|
24 | else
|
25 | TESTFILE="$TESTFILE `perl -e 'use Cwd "abs_path";print abs_path(shift)' $1`"
|
26 | fi
|
27 | shift
|
28 | done
|
29 |
|
30 |
|
31 | cd $SCRIPTDIR
|
32 | rm -f *.xml
|
33 |
|
34 |
|
35 | cd ..
|
36 | git submodule update --init
|
37 |
|
38 |
|
39 | cd $SCRIPTDIR
|
40 | /usr/bin/env phantomjs $SCRIPTDIR/phantomjs-testrunner.js $TESTFILE
|