1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test C support: comments meant for xgettext, whitespace, and literals.
5
6cat <<EOF > xg-c-2.in.c
7This is a test of the xgettext functionality.
8/* xgettext:no-c-format */
9_("extract me")
10Sometimes keywords can be spread apart
11xgettext:no-c-format
12_ ( "what about me" )
13And even further on accasion
14_
15(
16"hello"
17)
18static int c = '';
19_("after character")
20static char *s = "";
21_("after string")
22static double d = 10e-1;
23_("after double")
24EOF
25
26: ${XGETTEXT=xgettext}
27${XGETTEXT} -d xg-c-2.tmp -k_ --omit-header --no-location xg-c-2.in.c || Exit 1
28LC_ALL=C tr -d '\r' < xg-c-2.tmp.po > xg-c-2.po || Exit 1
29
30cat <<EOF > xg-c-2.ok
31#, no-c-format
32msgid "extract me"
33msgstr ""
34
35msgid "what about me"
36msgstr ""
37
38msgid "hello"
39msgstr ""
40
41msgid "after character"
42msgstr ""
43
44msgid "after string"
45msgstr ""
46
47msgid "after double"
48msgstr ""
49EOF
50
51: ${DIFF=diff}
52${DIFF} xg-c-2.ok xg-c-2.po
53result=$?
54
55exit $result
56