/[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 130 by siliconforks, Tue Jun 3 02:41:23 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  rm -fr EXPECTED DIR OUT  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
51  mkdir DIR  mkdir DIR
52  $VALGRIND jscoverage-server --document-root=recursive --report-dir=DIR &  $VALGRIND jscoverage-server --no-highlight --document-root=recursive --report-dir=DIR &
53  server_pid=$!  server_pid=$!
54  server_port=8080  server_port=8080
55    
# Line 53  Line 60 
60  wget -q -O- http://127.0.0.1:8080/unix.txt | diff recursive/unix.txt -  wget -q -O- http://127.0.0.1:8080/unix.txt | diff recursive/unix.txt -
61  wget -q -O- http://127.0.0.1:8080/windows.txt | diff recursive/windows.txt -  wget -q -O- http://127.0.0.1:8080/windows.txt | diff recursive/windows.txt -
62  wget -q -O- http://127.0.0.1:8080/image.png | diff recursive/image.png -  wget -q -O- http://127.0.0.1:8080/image.png | diff recursive/image.png -
63    wget -q -O- http://127.0.0.1:8080/x | diff recursive/x -
64  wget -q -O- http://127.0.0.1:8080/1/1.html | diff recursive/1/1.html -  wget -q -O- http://127.0.0.1:8080/1/1.html | diff recursive/1/1.html -
65  wget -q -O- http://127.0.0.1:8080/1/1.css | diff recursive/1/1.css -  wget -q -O- http://127.0.0.1:8080/1/1.css | diff recursive/1/1.css -
66  wget -q -O- http://127.0.0.1:8080/1/2/2.html | diff recursive/1/2/2.html -  wget -q -O- http://127.0.0.1:8080/1/2/2.html | diff recursive/1/2/2.html -
# Line 63  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 recursive.expected/script.js ../report.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 recursive.expected/1/1.js ../report.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 recursive.expected/1/2/2.js ../report.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 82  Line 90 
90  diff ../jscoverage.html DIR/jscoverage.html  diff ../jscoverage.html DIR/jscoverage.html
91  diff ../jscoverage.css DIR/jscoverage.css  diff ../jscoverage.css DIR/jscoverage.css
92  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  
93  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
94    
95  # 404 not found  # 404 not found
# Line 112  Line 117 
117  mkdir DIR  mkdir DIR
118  case `uname` in  case `uname` in
119    MINGW*)    MINGW*)
120      $VALGRIND jscoverage-server --port=8081 --document-root=recursive --report-dir=DIR --no-instrument=1/ &      $VALGRIND jscoverage-server --no-highlight --port=8081 --document-root=recursive --report-dir=DIR --no-instrument=1/ &
121      ;;      ;;
122    *)    *)
123      $VALGRIND jscoverage-server --port=8081 --document-root=recursive --report-dir=DIR --no-instrument=/1/ &      $VALGRIND jscoverage-server --no-highlight --port=8081 --document-root=recursive --report-dir=DIR --no-instrument=/1/ &
124      ;;      ;;
125  esac  esac
126  server_pid=$!  server_pid=$!
# Line 124  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 recursive.expected/script.js ../report.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
138    
139  $VALGRIND jscoverage-server --port 8082 --document-root recursive --report-dir DIR --no-instrument 1/ &  $VALGRIND jscoverage-server --no-highlight --port 8082 --document-root recursive --report-dir DIR --no-instrument 1/ &
140  server_pid=$!  server_pid=$!
141  server_port=8082  server_port=8082
142    
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 recursive.expected/script.js ../report.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.130  
changed lines
  Added in v.314

  ViewVC Help
Powered by ViewVC 1.1.24