--- trunk/tests/store-unreadable-json.sh 2008/05/31 21:39:39 114 +++ trunk/tests/store-unreadable-json.sh 2010/01/02 04:55:54 505 @@ -1,6 +1,6 @@ #!/bin/sh # store-unreadable-json.sh - test store when jscoverage.json is not readable -# Copyright (C) 2008 siliconforks.com +# Copyright (C) 2008, 2009, 2010 siliconforks.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,19 +18,27 @@ set -e -function shutdown() { +. ./common.sh + +# skip on windows +uname=`uname` +case "$uname" in + CYGWIN* | MINGW*) + exit 77 + ;; +esac + +shutdown() { wget -q -O- --post-data= "http://127.0.0.1:${server_port}/jscoverage-shutdown" > /dev/null wait $server_pid } -function cleanup() { +cleanup() { shutdown } trap 'cleanup' 0 1 2 3 15 -export PATH=.:..:../js:$PATH - if [ -z "$VALGRIND" ] then delay=0.2 @@ -39,7 +47,7 @@ fi rm -fr DIR -$VALGRIND jscoverage-server --document-root=recursive --report-dir=DIR > OUT 2> ERR & +$VALGRIND jscoverage-server --no-highlight --document-root=recursive --report-dir=DIR > OUT 2> ERR & server_pid=$! server_port=8080 @@ -48,7 +56,7 @@ cat store.json | sed "s/@PREFIX@/\\//g" > TMP wget --post-file=TMP -q -O- http://127.0.0.1:8080/jscoverage-store > /dev/null cat store.expected.json | sed "s/@PREFIX@/\\//g" > TMP -js json-cmp.js TMP DIR/jscoverage.json +json_cmp TMP DIR/jscoverage.json chmod -r DIR/jscoverage.json