• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#!/bin/sh
2#
3# Some tests for java plural keyword support
4#
5
6tmpfiles=""
7trap 'rm -fr $tmpfiles' 1 2 3 15
8
9tmpfiles="$tmpfiles xg-j-3.java"
10cat <<EOF > xg-j-3.java
11class TestCase {
12    public TestCase() {
13        Bundle test = Bundle.getBundle();
14        test.ngettext("test 1", "plural test");
15    }
16}
17EOF
18
19tmpfiles="$tmpfiles xg-j-3.tmp.po xg-j-3.po"
20: ${XGETTEXT=xgettext}
21${XGETTEXT} --omit-header --no-location -d xg-j-3.tmp xg-j-3.java
22test $? = 0 || { rm -fr $tmpfiles; exit 1; }
23tr -d '\r' < xg-j-3.tmp.po > xg-j-3.po
24test $? = 0 || { rm -fr $tmpfiles; exit 1; }
25
26tmpfiles="$tmpfiles xg-j-3.ok"
27cat <<EOF > xg-j-3.ok
28msgid "test 1"
29msgid_plural "plural test"
30msgstr[0] ""
31msgstr[1] ""
32EOF
33
34: ${DIFF=diff}
35${DIFF} xg-j-3.ok xg-j-3.po
36result=$?
37
38rm -fr $tmpfiles
39
40exit $result
41