1 |
#!/bin/sh |
#!/bin/sh |
2 |
# javascript-utf-8.sh - test a JavaScript file with UTF-8 encoding |
# javascript-utf-8.sh - test a JavaScript file with UTF-8 encoding |
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 |
22 |
|
|
23 |
export PATH=.:..:$PATH |
export PATH=.:..:$PATH |
24 |
|
|
25 |
|
if jscoverage-server --version | grep -q 'iconv\|MultiByteToWideChar' |
26 |
|
then |
27 |
|
character_encoding_support=yes |
28 |
|
else |
29 |
|
character_encoding_support=no |
30 |
|
fi |
31 |
|
|
32 |
rm -fr DIR |
rm -fr DIR |
33 |
$VALGRIND jscoverage --no-highlight --encoding=UTF-8 javascript-utf-8 DIR |
case "$character_encoding_support" in |
34 |
diff -u --strip-trailing-cr javascript-utf-8.expected/javascript-utf-8.js DIR/javascript-utf-8.js |
yes) |
35 |
|
$VALGRIND jscoverage --no-highlight --encoding=UTF-8 javascript-utf-8 DIR |
36 |
|
diff -u --strip-trailing-cr javascript-utf-8.expected/javascript-utf-8.js DIR/javascript-utf-8.js |
37 |
|
;; |
38 |
|
*) |
39 |
|
! $VALGRIND jscoverage --no-highlight --encoding=UTF-8 javascript-utf-8 DIR > OUT 2> ERR |
40 |
|
echo "jscoverage: encoding UTF-8 not supported" | diff - ERR |
41 |
|
;; |
42 |
|
esac |
43 |
rm -fr DIR |
rm -fr DIR |