/[jscoverage]/trunk/tests/server.sh
ViewVC logotype

Diff of /trunk/tests/server.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 249 by siliconforks, Sun Oct 5 18:07:02 2008 UTC revision 314 by siliconforks, Mon Oct 13 17:52:41 2008 UTC
# Line 40  Line 40 
40    delay=2    delay=2
41  fi  fi
42    
43    if jscoverage-server --version | grep -q 'iconv\|MultiByteToWideChar'
44    then
45      character_encoding_support=yes
46    else
47      character_encoding_support=no
48    fi
49    
50  rm -fr EXPECTED ACTUAL DIR OUT  rm -fr EXPECTED ACTUAL DIR OUT
51  mkdir DIR  mkdir DIR
52  $VALGRIND jscoverage-server --no-highlight --document-root=recursive --report-dir=DIR &  $VALGRIND jscoverage-server --no-highlight --document-root=recursive --report-dir=DIR &
# Line 64  Line 71 
71    
72  # test javascript  # test javascript
73  wget -q -O- http://127.0.0.1:8080/script.js > OUT  wget -q -O- http://127.0.0.1:8080/script.js > OUT
74  cat ../report.js recursive.expected/script.js | sed 's/@PREFIX@/\//g' | diff - OUT  cat ../report.js recursive.expected/script.js | sed 's/@PREFIX@/\//g' | diff --strip-trailing-cr - OUT
75  wget -q -O- http://127.0.0.1:8080/1/1.js > OUT  wget -q -O- http://127.0.0.1:8080/1/1.js > OUT
76  cat ../report.js recursive.expected/1/1.js | sed 's/@PREFIX@/\//g' | diff - OUT  cat ../report.js recursive.expected/1/1.js | sed 's/@PREFIX@/\//g' | diff --strip-trailing-cr - OUT
77  wget -q -O- http://127.0.0.1:8080/1/2/2.js > OUT  wget -q -O- http://127.0.0.1:8080/1/2/2.js > OUT
78  cat ../report.js recursive.expected/1/2/2.js | sed 's/@PREFIX@/\//g' | diff - OUT  cat ../report.js recursive.expected/1/2/2.js | sed 's/@PREFIX@/\//g' | diff --strip-trailing-cr - OUT
79    
80  # test jscoverage  # test jscoverage
81  wget -q -O- http://127.0.0.1:8080/jscoverage.html | diff ../jscoverage.html -  wget -q -O- http://127.0.0.1:8080/jscoverage.html | diff ../jscoverage.html -
# Line 122  Line 129 
129  sleep $delay  sleep $delay
130    
131  wget -q -O- http://127.0.0.1:8081/script.js > OUT  wget -q -O- http://127.0.0.1:8081/script.js > OUT
132  cat ../report.js recursive.expected/script.js | sed 's/@PREFIX@/\//g' | diff - OUT  cat ../report.js recursive.expected/script.js | sed 's/@PREFIX@/\//g' | diff --strip-trailing-cr - OUT
133  wget -q -O- http://127.0.0.1:8081/1/1.js | diff recursive/1/1.js -  wget -q -O- http://127.0.0.1:8081/1/1.js | diff --strip-trailing-cr recursive/1/1.js -
134  wget -q -O- http://127.0.0.1:8081/1/2/2.js | diff recursive/1/2/2.js -  wget -q -O- http://127.0.0.1:8081/1/2/2.js | diff --strip-trailing-cr recursive/1/2/2.js -
135    
136  # kill $server_pid  # kill $server_pid
137  shutdown  shutdown
# Line 136  Line 143 
143  sleep $delay  sleep $delay
144    
145  wget -q -O- http://127.0.0.1:8082/script.js > OUT  wget -q -O- http://127.0.0.1:8082/script.js > OUT
146  cat ../report.js recursive.expected/script.js | sed 's/@PREFIX@/\//g' | diff - OUT  cat ../report.js recursive.expected/script.js | sed 's/@PREFIX@/\//g' | diff --strip-trailing-cr - OUT
147  wget -q -O- http://127.0.0.1:8082/1/1.js | diff recursive/1/1.js -  wget -q -O- http://127.0.0.1:8082/1/1.js | diff --strip-trailing-cr recursive/1/1.js -
148  wget -q -O- http://127.0.0.1:8082/1/2/2.js | diff recursive/1/2/2.js -  wget -q -O- http://127.0.0.1:8082/1/2/2.js | diff --strip-trailing-cr recursive/1/2/2.js -
149    
150    # kill $server_pid
151    shutdown
152    
153    $VALGRIND jscoverage-server --port 8080 --encoding iso-8859-1 --document-root javascript &
154    server_pid=$!
155    server_port=8080
156    
157    sleep $delay
158    
159    case "$character_encoding_support" in
160      yes)
161        wget -q -O- http://127.0.0.1:8080/javascript-iso-8859-1.js > OUT
162        cat ../report.js javascript.expected/javascript-iso-8859-1.js | sed 's/javascript-iso-8859-1.js/\/javascript-iso-8859-1.js/g' | diff --strip-trailing-cr - OUT
163        ;;
164      *)
165        echo 500 > EXPECTED
166        ! curl -f -w '%{http_code}\n' http://127.0.0.1:8080/javascript-iso-8859-1.js 2> /dev/null > ACTUAL
167        diff EXPECTED ACTUAL
168        ;;
169    esac
170    
171    # kill $server_pid
172    shutdown
173    
174    $VALGRIND jscoverage-server --no-highlight --port=8080 --encoding=utf-8 --document-root=javascript-utf-8 &
175    server_pid=$!
176    server_port=8080
177    
178    sleep $delay
179    
180    case "$character_encoding_support" in
181      yes)
182        wget -q -O- http://127.0.0.1:8080/javascript-utf-8.js > OUT
183        cat ../report.js javascript-utf-8.expected/javascript-utf-8.js | sed 's/javascript-utf-8.js/\/javascript-utf-8.js/g' | diff --strip-trailing-cr - OUT
184        ;;
185      *)
186        echo 500 > EXPECTED
187        ! curl -f -w '%{http_code}\n' http://127.0.0.1:8080/javascript-utf-8.js 2> /dev/null > ACTUAL
188        diff EXPECTED ACTUAL
189        ;;
190    esac
191    
192    # kill $server_pid
193    shutdown
194    
195    $VALGRIND jscoverage-server --port 8080 --encoding BOGUS --document-root javascript &
196    server_pid=$!
197    server_port=8080
198    
199    sleep $delay
200    
201    echo 500 > EXPECTED
202    ! curl -f -w '%{http_code}\n' http://127.0.0.1:8080/javascript-iso-8859-1.js 2> /dev/null > ACTUAL
203    diff EXPECTED ACTUAL
204    
205    # kill $server_pid
206    shutdown
207    
208    $VALGRIND jscoverage-server --port 8080 --encoding utf-8 --document-root javascript &
209    server_pid=$!
210    server_port=8080
211    
212    sleep $delay
213    
214    echo 500 > EXPECTED
215    ! curl -f -w '%{http_code}\n' http://127.0.0.1:8080/javascript-iso-8859-1.js 2> /dev/null > ACTUAL
216    diff EXPECTED ACTUAL

Legend:
Removed from v.249  
changed lines
  Added in v.314

  ViewVC Help
Powered by ViewVC 1.1.24