Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test multi-domain handling.
      4  1.1  christos 
      5  1.1  christos tmpfiles=""
      6  1.1  christos trap 'rm -fr $tmpfiles' 1 2 3 15
      7  1.1  christos 
      8  1.1  christos tmpfiles="$tmpfiles foo.po"
      9  1.1  christos cat <<\EOF > foo.po
     10  1.1  christos domain "foo-de"
     11  1.1  christos msgid ""
     12  1.1  christos msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
     13  1.1  christos 
     14  1.1  christos # Das ist ein Kommentar.
     15  1.1  christos msgid "hello"
     16  1.1  christos msgstr "Hallo"
     17  1.1  christos 
     18  1.1  christos # Noch einer.
     19  1.1  christos msgid "bye"
     20  1.1  christos msgstr "Tsch"
     21  1.1  christos 
     22  1.1  christos domain "foo-fr"
     23  1.1  christos msgid ""
     24  1.1  christos msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
     25  1.1  christos 
     26  1.1  christos # Ceci est un commentaire.
     27  1.1  christos msgid "hello"
     28  1.1  christos msgstr "Salut"
     29  1.1  christos 
     30  1.1  christos # Encore un.
     31  1.1  christos msgid "bye"
     32  1.1  christos msgstr "A bientt"
     33  1.1  christos EOF
     34  1.1  christos 
     35  1.1  christos tmpfiles="$tmpfiles foo-de.mo foo-fr.mo"
     36  1.1  christos : ${MSGFMT=msgfmt}
     37  1.1  christos ${MSGFMT} foo.po
     38  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     39  1.1  christos 
     40  1.1  christos tmpfiles="$tmpfiles foo-de.out foo-fr.out"
     41  1.1  christos : ${MSGUNFMT=msgunfmt}
     42  1.1  christos ${MSGUNFMT} -o foo-de.out foo-de.mo
     43  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     44  1.1  christos ${MSGUNFMT} -o foo-fr.out foo-fr.mo
     45  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     46  1.1  christos 
     47  1.1  christos tmpfiles="$tmpfiles foo-de.ok"
     48  1.1  christos cat <<\EOF > foo-de.ok
     49  1.1  christos msgid ""
     50  1.1  christos msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
     51  1.1  christos 
     52  1.1  christos msgid "bye"
     53  1.1  christos msgstr "Tsch"
     54  1.1  christos 
     55  1.1  christos msgid "hello"
     56  1.1  christos msgstr "Hallo"
     57  1.1  christos EOF
     58  1.1  christos 
     59  1.1  christos tmpfiles="$tmpfiles foo-fr.ok"
     60  1.1  christos cat <<\EOF > foo-fr.ok
     61  1.1  christos msgid ""
     62  1.1  christos msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
     63  1.1  christos 
     64  1.1  christos msgid "bye"
     65  1.1  christos msgstr "A bientt"
     66  1.1  christos 
     67  1.1  christos msgid "hello"
     68  1.1  christos msgstr "Salut"
     69  1.1  christos EOF
     70  1.1  christos 
     71  1.1  christos : ${DIFF=diff}
     72  1.1  christos ${DIFF} foo-de.ok foo-de.out && ${DIFF} foo-fr.ok foo-fr.out
     73  1.1  christos result=$?
     74  1.1  christos 
     75  1.1  christos rm -fr $tmpfiles
     76  1.1  christos 
     77  1.1  christos exit $result
     78