Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-csharp-7
1 #! /bin/sh
2
3 # Test C# support: extraction of contexts.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles xg-cs-7.cs"
9 cat <<\EOF > xg-cs-7.cs
10 Console.WriteLine(rm.GetString("help"));
11 Console.WriteLine(rm.GetParticularString("Help", "about"));
12 EOF
13
14 tmpfiles="$tmpfiles xg-cs-7.tmp.po xg-cs-7.po"
15 : ${XGETTEXT=xgettext}
16 ${XGETTEXT} --omit-header --no-location -d xg-cs-7.tmp xg-cs-7.cs
17 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
18 LC_ALL=C tr -d '\r' < xg-cs-7.tmp.po > xg-cs-7.po
19 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
20
21 tmpfiles="$tmpfiles xg-cs-7.ok"
22 cat <<EOF > xg-cs-7.ok
23 msgid "help"
24 msgstr ""
25
26 msgctxt "Help"
27 msgid "about"
28 msgstr ""
29 EOF
30
31 : ${DIFF=diff}
32 ${DIFF} xg-cs-7.ok xg-cs-7.po
33 result=$?
34
35 rm -fr $tmpfiles
36
37 exit $result