Add -lm dependency for gettextlib to fix LTO build
[platform/upstream/gettext.git] / gettext-tools / tests / msgcat-stringtable-1
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test reading in NeXTstep/GNUstep .strings syntax.
5
6 cat <<\EOF > mcat-s-1.in
7 /* This is an example of a string table file. Everything inside a comment
8 is completely ignored, even if in "quotes", or \escape characters, etc.
9 */
10
11 "title" = "pattern II target 1";
12
13 /* This is an example of excape codes in the string table, codes */
14 /* that are not one of abfnrtv are stripped of the \ character */
15 "escapes"    = "This is a tab \t and a return \n or a \a but not a \p";
16 "escapes2"    = "Well how about a \0? Guess not.";
17
18 /* more parameters, white space between tokens is ignored */
19 "actualSize"    
20         = 
21                 "0.000250 0.000250";
22
23 /* a key with no value assumes the value is the empty string */
24 "hoe322070.element";
25 EOF
26
27 rm -f mcat-s-1.tmp
28 : ${MSGCAT=msgcat}
29 LC_MESSAGES=C LC_ALL= \
30 ${MSGCAT} --stringtable-input -o mcat-s-1.tmp mcat-s-1.in >mcat-s-1.err 2>&1
31 result=$?
32 cat mcat-s-1.err | grep -v ': internationalized messages'
33 test $result = 0 || { exit 1; }
34 LC_ALL=C tr -d '\r' < mcat-s-1.tmp > mcat-s-1.out || exit 1
35
36 cat << \EOF > mcat-s-1.ok
37 # This is an example of a string table file. Everything inside a comment
38 # is completely ignored, even if in "quotes", or \escape characters, etc.
39 #
40 msgid "title"
41 msgstr "pattern II target 1"
42
43 # This is an example of excape codes in the string table, codes
44 # that are not one of abfnrtv are stripped of the \ character
45 msgid "escapes"
46 msgstr ""
47 "This is a tab \t and a return \n"
48 " or a \a but not a p"
49
50 msgid "escapes2"
51 msgstr "Well how about a "
52
53 # more parameters, white space between tokens is ignored
54 msgid "actualSize"
55 msgstr "0.000250 0.000250"
56
57 # a key with no value assumes the value is the empty string
58 msgid "hoe322070.element"
59 msgstr ""
60 EOF
61
62 : ${DIFF=diff}
63 ${DIFF} mcat-s-1.ok mcat-s-1.out
64 result=$?
65
66 exit $result