/[jscoverage]/trunk/tests/store-unreadable-json.sh
ViewVC logotype

Diff of /trunk/tests/store-unreadable-json.sh

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

revision 122 by siliconforks, Sun Jun 1 14:08:57 2008 UTC revision 505 by siliconforks, Sat Jan 2 04:55:54 2010 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  #    store-unreadable-json.sh - test store when jscoverage.json is not readable  #    store-unreadable-json.sh - test store when jscoverage.json is not readable
3  #    Copyright (C) 2008 siliconforks.com  #    Copyright (C) 2008, 2009, 2010 siliconforks.com
4  #  #
5  #    This program is free software; you can redistribute it and/or modify  #    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  #    it under the terms of the GNU General Public License as published by
# Line 18  Line 18 
18    
19  set -e  set -e
20    
21    . ./common.sh
22    
23  # skip on windows  # skip on windows
24  uname=`uname`  uname=`uname`
25  case "$uname" in  case "$uname" in
# Line 26  Line 28 
28      ;;      ;;
29  esac  esac
30    
31  function shutdown() {  shutdown() {
32    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
33    wait $server_pid    wait $server_pid
34  }  }
35    
36  function cleanup() {  cleanup() {
37    shutdown    shutdown
38  }  }
39    
40  trap 'cleanup' 0 1 2 3 15  trap 'cleanup' 0 1 2 3 15
41    
 export PATH=.:..:../js:$PATH  
   
42  if [ -z "$VALGRIND" ]  if [ -z "$VALGRIND" ]
43  then  then
44    delay=0.2    delay=0.2
# Line 47  Line 47 
47  fi  fi
48    
49  rm -fr DIR  rm -fr DIR
50  $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 &
51  server_pid=$!  server_pid=$!
52  server_port=8080  server_port=8080
53    
# Line 56  Line 56 
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  chmod -r DIR/jscoverage.json  chmod -r DIR/jscoverage.json
62    

Legend:
Removed from v.122  
changed lines
  Added in v.505

  ViewVC Help
Powered by ViewVC 1.1.24