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

Contents of /trunk/tests/fatal.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 307 - (show annotations)
Mon Oct 13 06:12:55 2008 UTC (11 years, 2 months ago) by siliconforks
File MIME type: application/x-sh
File size: 3118 byte(s)
Add --strip-trailing-cr for Windows.
1 #!/bin/sh
2 # fatal.sh - test various fatal errors
3 # Copyright (C) 2007, 2008 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 trap 'rm -fr DIR DIR2 OUT ERR' 1 2 3 15
22
23 export PATH=.:..:$PATH
24
25 rm -fr DIR DIR2
26
27 $VALGRIND jscoverage javascript-xml DIR > OUT 2> ERR && exit 1
28 test ! -s OUT
29 test -s ERR
30 diff --strip-trailing-cr javascript-xml.expected.err ERR
31
32 rm -fr DIR
33
34 $VALGRIND jscoverage javascript-invalid DIR > OUT 2> ERR && exit 1
35 test ! -s OUT
36 test -s ERR
37 diff --strip-trailing-cr javascript-invalid.expected.err ERR
38
39 rm -fr DIR
40
41 $VALGRIND jscoverage javascript-setter DIR > OUT 2> ERR && exit 1
42 test ! -s OUT
43 test -s ERR
44 diff --strip-trailing-cr javascript-setter.expected.err ERR
45
46 rm -fr DIR
47
48 $VALGRIND jscoverage 1 2 3 > OUT 2> ERR && exit 1
49 test ! -s OUT
50 test -s ERR
51 diff --strip-trailing-cr too-many-arguments.expected.err ERR
52
53 rm -fr DIR
54
55 $VALGRIND jscoverage --no-instrument > OUT 2> ERR && exit 1
56 test ! -s OUT
57 test -s ERR
58 diff --strip-trailing-cr no-instrument-requires-argument.expected.err ERR
59
60 $VALGRIND jscoverage --exclude > OUT 2> ERR && exit 1
61 test ! -s OUT
62 test -s ERR
63 diff --strip-trailing-cr exclude-requires-argument.expected.err ERR
64
65 $VALGRIND jscoverage --encoding > OUT 2> ERR && exit 1
66 test ! -s OUT
67 test -s ERR
68 diff --strip-trailing-cr encoding-requires-argument.expected.err ERR
69
70 # first arg does not exist
71 rm -f foo
72 $VALGRIND jscoverage foo bar > OUT 2> ERR && exit 1
73 test ! -s OUT
74 test -s ERR
75 # diff --strip-trailing-cr source-does-not-exist.expected.err ERR
76
77 # first arg is file
78 touch foo
79 $VALGRIND jscoverage foo bar > OUT 2> ERR && exit 1
80 test ! -s OUT
81 test -s ERR
82 # diff --strip-trailing-cr source-is-file.expected.err ERR
83 rm foo
84
85 # second arg is file
86 rm -fr bar
87 touch bar
88 $VALGRIND jscoverage javascript bar > OUT 2> ERR && exit 1
89 test ! -s OUT
90 test -s ERR
91 # diff --strip-trailing-cr destination-is-file.expected.err ERR
92 rm bar
93
94 # second arg is directory, but not from previous run
95 rm -fr bar
96 mkdir bar
97 touch bar/foo
98 $VALGRIND jscoverage javascript bar > OUT 2> ERR && exit 1
99 test ! -s OUT
100 test -s ERR
101 # diff --strip-trailing-cr destination-is-existing-directory.expected.err ERR
102 rm -fr bar
103
104 # huge JavaScript file
105 mkdir -p DIR
106 perl -e 'for (1 .. 65536) {print "x = $_\n";}' > DIR/big.js
107 $VALGRIND jscoverage DIR DIR2 > OUT 2> ERR && exit 1
108 echo 'jscoverage: big.js: script has more than 65,535 lines' | diff --strip-trailing-cr - ERR
109
110 rm -fr DIR DIR2 OUT ERR

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.24