scratch – Blame information for rev 58
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
58 | office | 1 | #!/bin/bash |
2 | |||
3 | # sanity check to make sure phantomjs exists in the PATH |
||
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 | # sanity check number of args |
||
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 | # cleanup previous test runs |
||
31 | cd $SCRIPTDIR |
||
32 | rm -f *.xml |
||
33 | |||
34 | # make sure phantomjs submodule is initialized |
||
35 | cd .. |
||
36 | git submodule update --init |
||
37 | |||
38 | # fire up the phantomjs environment and run the test |
||
39 | cd $SCRIPTDIR |
||
40 | /usr/bin/env phantomjs $SCRIPTDIR/phantomjs-testrunner.js $TESTFILE |