/[jscoverage]/trunk/tests/server-content-types.sh
ViewVC logotype

Contents of /trunk/tests/server-content-types.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 610 - (show annotations)
Fri Sep 24 20:35:36 2010 UTC (9 years, 6 months ago) by siliconforks
File MIME type: application/x-sh
File size: 2230 byte(s)
Remove hard-coded port numbers.

1 #!/bin/sh
2 # server-content-types.sh - test jscoverage-server Content-Type headers
3 # Copyright (C) 2008, 2009, 2010 siliconforks.com
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19 set -e
20
21 shutdown() {
22 wget -q -O- --post-data= "http://127.0.0.1:${server_port}/jscoverage-shutdown" > /dev/null
23 wait $server_pid
24 }
25
26 cleanup() {
27 shutdown
28 rm -f x x.y
29 }
30
31 trap 'cleanup' 0 1 2 3 15
32
33 . ./common.sh
34
35 server_port=`perl unused-port.pl`
36 $VALGRIND jscoverage-server --port=$server_port > OUT 2> ERR &
37 server_pid=$!
38
39 wait_for_server http://127.0.0.1:${server_port}/jscoverage.html
40
41 echo text/html > EXPECTED
42 ! curl -f -w '%{content_type}\n' -o /dev/null http://127.0.0.1:${server_port}/recursive/index.html 2> /dev/null > ACTUAL
43 diff --strip-trailing-cr EXPECTED ACTUAL
44
45 echo text/plain > EXPECTED
46 ! curl -f -w '%{content_type}\n' -o /dev/null http://127.0.0.1:${server_port}/recursive/unix.txt 2> /dev/null > ACTUAL
47 diff --strip-trailing-cr EXPECTED ACTUAL
48
49 echo text/plain > EXPECTED
50 ! curl -f -w '%{content_type}\n' -o /dev/null http://127.0.0.1:${server_port}/recursive/windows.txt 2> /dev/null > ACTUAL
51 diff --strip-trailing-cr EXPECTED ACTUAL
52
53 touch x
54 echo application/octet-stream > EXPECTED
55 ! curl -f -w '%{content_type}\n' -o /dev/null http://127.0.0.1:${server_port}/x 2> /dev/null > ACTUAL
56 diff --strip-trailing-cr EXPECTED ACTUAL
57
58 touch x.y
59 echo application/octet-stream > EXPECTED
60 ! curl -f -w '%{content_type}\n' -o /dev/null http://127.0.0.1:${server_port}/x.y 2> /dev/null > ACTUAL
61 diff --strip-trailing-cr EXPECTED ACTUAL

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.24