18 |
|
|
19 |
set -e |
set -e |
20 |
|
|
21 |
function shutdown() { |
shutdown() { |
22 |
wget -q -O- --post-data= "http://127.0.0.1:${proxy_server_port}/jscoverage-shutdown" > /dev/null |
wget -q -O- --post-data= "http://127.0.0.1:${proxy_server_port}/jscoverage-shutdown" > /dev/null |
23 |
wait $proxy_server_pid |
wait $proxy_server_pid |
24 |
} |
} |
25 |
|
|
26 |
function cleanup() { |
shutdown_perl() { |
27 |
|
wget -q -O- --post-data= http://127.0.0.1:8000/perl-shutdown > /dev/null |
28 |
|
wait $origin_server_pid |
29 |
|
} |
30 |
|
|
31 |
|
cleanup() { |
32 |
rm -fr EXPECTED ACTUAL DIR OUT |
rm -fr EXPECTED ACTUAL DIR OUT |
|
kill $python_server_pid |
|
|
# kill $proxy_server_pid |
|
33 |
shutdown |
shutdown |
34 |
|
shutdown_perl |
35 |
} |
} |
36 |
|
|
37 |
trap 'cleanup' 0 1 2 3 15 |
trap 'cleanup' 0 1 2 3 15 |
46 |
fi |
fi |
47 |
|
|
48 |
cd recursive |
cd recursive |
49 |
python ../POSTServer.py > /dev/null 2> /dev/null & |
perl ../server.pl > /dev/null 2> /dev/null & |
50 |
python_server_pid=$! |
origin_server_pid=$! |
51 |
cd .. |
cd .. |
52 |
|
|
53 |
rm -fr DIR |
rm -fr DIR |
54 |
mkdir DIR |
mkdir DIR |
55 |
$VALGRIND jscoverage-server --proxy --report-dir=DIR > OUT 2> ERR & |
$VALGRIND jscoverage-server --no-highlight --proxy --report-dir=DIR > OUT 2> ERR & |
56 |
proxy_server_pid=$! |
proxy_server_pid=$! |
57 |
proxy_server_port=8080 |
proxy_server_port=8080 |
58 |
|
|
76 |
|
|
77 |
# test javascript |
# test javascript |
78 |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/script.js > OUT |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/script.js > OUT |
79 |
cat recursive.expected/script.js ../report.js | sed 's/@PREFIX@/http:\/\/127.0.0.1:8000\//g' | diff - OUT |
cat ../report.js recursive.expected/script.js | sed 's/@PREFIX@/http:\/\/127.0.0.1:8000\//g' | diff - OUT |
80 |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/1/1.js > OUT |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/1/1.js > OUT |
81 |
cat recursive.expected/1/1.js ../report.js | sed 's/@PREFIX@/http:\/\/127.0.0.1:8000\//g' | diff - OUT |
cat ../report.js recursive.expected/1/1.js | sed 's/@PREFIX@/http:\/\/127.0.0.1:8000\//g' | diff - OUT |
82 |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/1/2/2.js > OUT |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/1/2/2.js > OUT |
83 |
cat recursive.expected/1/2/2.js ../report.js | sed 's/@PREFIX@/http:\/\/127.0.0.1:8000\//g' | diff - OUT |
cat ../report.js recursive.expected/1/2/2.js | sed 's/@PREFIX@/http:\/\/127.0.0.1:8000\//g' | diff - OUT |
84 |
|
|
85 |
## test jscoverage |
## test jscoverage |
86 |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://siliconforks.com/jscoverage.html | diff ../jscoverage.html - |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://siliconforks.com/jscoverage.html | diff ../jscoverage.html - |
95 |
diff ../jscoverage.html DIR/jscoverage.html |
diff ../jscoverage.html DIR/jscoverage.html |
96 |
diff ../jscoverage.css DIR/jscoverage.css |
diff ../jscoverage.css DIR/jscoverage.css |
97 |
diff ../jscoverage-throbber.gif DIR/jscoverage-throbber.gif |
diff ../jscoverage-throbber.gif DIR/jscoverage-throbber.gif |
|
diff ../jscoverage-sh_main.js DIR/jscoverage-sh_main.js |
|
|
diff ../jscoverage-sh_javascript.js DIR/jscoverage-sh_javascript.js |
|
|
diff ../jscoverage-sh_nedit.css DIR/jscoverage-sh_nedit.css |
|
98 |
echo -e 'jscoverage_isReport = true;\r' | cat ../jscoverage.js - | diff - DIR/jscoverage.js |
echo -e 'jscoverage_isReport = true;\r' | cat ../jscoverage.js - | diff - DIR/jscoverage.js |
99 |
|
|
100 |
## send it an FTP request |
## send it an FTP request |
123 |
# kill $proxy_server_pid |
# kill $proxy_server_pid |
124 |
shutdown |
shutdown |
125 |
|
|
126 |
$VALGRIND jscoverage-server --port=8081 --proxy --report-dir=DIR --no-instrument=http://127.0.0.1:8000/1/ & |
$VALGRIND jscoverage-server --no-highlight --port=8081 --proxy --report-dir=DIR --no-instrument=http://127.0.0.1:8000/1/ & |
127 |
proxy_server_pid=$! |
proxy_server_pid=$! |
128 |
proxy_server_port=8081 |
proxy_server_port=8081 |
129 |
|
|
130 |
sleep $delay |
sleep $delay |
131 |
|
|
132 |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8081/' http://127.0.0.1:8000/script.js > OUT |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8081/' http://127.0.0.1:8000/script.js > OUT |
133 |
cat recursive.expected/script.js ../report.js | sed 's/@PREFIX@/http:\/\/127.0.0.1:8000\//g' | diff - OUT |
cat ../report.js recursive.expected/script.js | sed 's/@PREFIX@/http:\/\/127.0.0.1:8000\//g' | diff - OUT |
134 |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8081/' http://127.0.0.1:8000/1/1.js | diff recursive/1/1.js - |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8081/' http://127.0.0.1:8000/1/1.js | diff recursive/1/1.js - |
135 |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8081/' http://127.0.0.1:8000/1/2/2.js | diff recursive/1/2/2.js - |
wget -q -O- -e 'http_proxy=http://127.0.0.1:8081/' http://127.0.0.1:8000/1/2/2.js | diff recursive/1/2/2.js - |