18 |
|
|
19 |
set -e |
set -e |
20 |
|
|
21 |
|
. common.sh |
22 |
|
|
23 |
shutdown() { |
shutdown() { |
24 |
wget -q -O- --post-data= "http://127.0.0.1:${server_port}/jscoverage-shutdown" > /dev/null |
wget -q -O- --post-data= "http://127.0.0.1:${server_port}/jscoverage-shutdown" > /dev/null |
25 |
wait $server_pid |
wait $server_pid |
56 |
cat store.json | sed "s/@PREFIX@/\\//g" > TMP |
cat store.json | sed "s/@PREFIX@/\\//g" > TMP |
57 |
wget --post-file=TMP -q -O- http://127.0.0.1:8080/jscoverage-store > /dev/null |
wget --post-file=TMP -q -O- http://127.0.0.1:8080/jscoverage-store > /dev/null |
58 |
cat store.expected.json | sed "s/@PREFIX@/\\//g" > TMP |
cat store.expected.json | sed "s/@PREFIX@/\\//g" > TMP |
59 |
js json-cmp.js TMP DIR/jscoverage.json |
json_cmp TMP DIR/jscoverage.json |
60 |
|
|
61 |
cat store.json | sed "s/@PREFIX@/\\//g" > TMP |
cat store.json | sed "s/@PREFIX@/\\//g" > TMP |
62 |
wget --post-file=TMP -q -O- http://127.0.0.1:8080/jscoverage-store > /dev/null |
wget --post-file=TMP -q -O- http://127.0.0.1:8080/jscoverage-store > /dev/null |
63 |
cat store.expected.json | sed "s/@PREFIX@/\\//g" | sed "s/,1/,2/g" > TMP |
cat store.expected.json | sed "s/@PREFIX@/\\//g" | sed "s/,1/,2/g" > TMP |
64 |
js json-cmp.js TMP DIR/jscoverage.json |
json_cmp TMP DIR/jscoverage.json |
65 |
|
|
66 |
# try invalid method |
# try invalid method |
67 |
echo 405 > EXPECTED |
echo 405 > EXPECTED |
72 |
cat store.json | sed "s/@PREFIX@/\\//g" > TMP |
cat store.json | sed "s/@PREFIX@/\\//g" > TMP |
73 |
wget --post-file=TMP -q -O- http://127.0.0.1:8080/jscoverage-store/DIR > /dev/null |
wget --post-file=TMP -q -O- http://127.0.0.1:8080/jscoverage-store/DIR > /dev/null |
74 |
cat store.expected.json | sed "s/@PREFIX@/\\//g" > TMP |
cat store.expected.json | sed "s/@PREFIX@/\\//g" > TMP |
75 |
js json-cmp.js TMP DIR/DIR/jscoverage.json |
json_cmp TMP DIR/DIR/jscoverage.json |
76 |
|
|
77 |
shutdown |
shutdown |
78 |
|
|
92 |
cat store.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
cat store.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
93 |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
94 |
cat store.expected.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
cat store.expected.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
95 |
js json-cmp.js TMP DIR/jscoverage.json |
json_cmp TMP DIR/jscoverage.json |
96 |
|
|
97 |
cat store.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
cat store.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
98 |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
99 |
cat store.expected.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" | sed "s/,1/,2/g" > TMP |
cat store.expected.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" | sed "s/,1/,2/g" > TMP |
100 |
js json-cmp.js TMP DIR/jscoverage.json |
json_cmp TMP DIR/jscoverage.json |
101 |
|
|
102 |
# test cached source |
# test cached source |
103 |
rm -fr DIR |
rm -fr DIR |
104 |
cat store.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
cat store.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
105 |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
106 |
cat store.expected.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
cat store.expected.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:8000\\//g" > TMP |
107 |
js json-cmp.js TMP DIR/jscoverage.json |
json_cmp TMP DIR/jscoverage.json |
108 |
|
|
109 |
shutdown |
shutdown |
110 |
|
|
118 |
# store JSON with bad source URLs |
# store JSON with bad source URLs |
119 |
cat store.json | sed "s/@PREFIX@//g" > TMP |
cat store.json | sed "s/@PREFIX@//g" > TMP |
120 |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
121 |
js json-cmp.js store-bad-source-urls.expected.json DIR/jscoverage.json |
json_cmp store-bad-source-urls.expected.json DIR/jscoverage.json |
122 |
sort ERR -o ERR |
sort ERR -o ERR |
123 |
diff --strip-trailing-cr store-bad-source-urls.expected.err ERR |
diff --strip-trailing-cr store-bad-source-urls.expected.err ERR |
124 |
|
|
134 |
# store JSON with unreachable source URLs |
# store JSON with unreachable source URLs |
135 |
cat store.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:1\\//g" > TMP |
cat store.json | sed "s/@PREFIX@/http:\\/\\/127.0.0.1:1\\//g" > TMP |
136 |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
wget --post-file=TMP -q -O- -e 'http_proxy=http://127.0.0.1:8080/' http://127.0.0.1:8000/jscoverage-store > /dev/null |
137 |
js json-cmp.js store-unreachable-source-urls.expected.json DIR/jscoverage.json |
json_cmp store-unreachable-source-urls.expected.json DIR/jscoverage.json |
138 |
sort ERR -o ERR |
sort ERR -o ERR |
139 |
diff --strip-trailing-cr store-unreachable-source-urls.expected.err ERR |
diff --strip-trailing-cr store-unreachable-source-urls.expected.err ERR |