Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test of an external command.
      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 mex-test1.po"
      9  1.1  christos cat <<\EOF > mex-test1.po
     10  1.1  christos # HEADER.
     11  1.1  christos #
     12  1.1  christos msgid ""
     13  1.1  christos msgstr ""
     14  1.1  christos "Project-Id-Version: Bonnie Tyler\n"
     15  1.1  christos "Content-Type: text/plain; charset=ISO-8859-1\n"
     16  1.1  christos "Content-Transfer-Encoding: 8bit\n"
     17  1.1  christos 
     18  1.1  christos #: married-men:4
     19  1.1  christos #, fuzzy
     20  1.1  christos msgid "The world is full of married men"
     21  1.1  christos msgstr "So viele verheiratete Mnner"
     22  1.1  christos 
     23  1.1  christos #: married-men:5
     24  1.1  christos msgid "with wives who never understand"
     25  1.1  christos msgstr "und ihre Frauen verstehen sie nicht"
     26  1.1  christos 
     27  1.1  christos #: married-men:6
     28  1.1  christos msgid "They're looking for someone to share"
     29  1.1  christos msgstr ""
     30  1.1  christos 
     31  1.1  christos # schwer zu bersetzen...
     32  1.1  christos #: married-men:7
     33  1.1  christos msgid "the excitement of a love affair"
     34  1.1  christos msgstr ""
     35  1.1  christos 
     36  1.1  christos #: married-men:8
     37  1.1  christos msgid "Just as soon as they find you"
     38  1.1  christos msgstr ""
     39  1.1  christos 
     40  1.1  christos #: married-men:9
     41  1.1  christos msgid "They warn you and darn you"
     42  1.1  christos msgstr ""
     43  1.1  christos 
     44  1.1  christos #~ msgid "You fly on the wings of romance"
     45  1.1  christos #~ msgstr "Die Flgel der frischen Liebe\n"
     46  1.1  christos #~ "heben dich zum Himmel"
     47  1.1  christos 
     48  1.1  christos #, fuzzy
     49  1.1  christos #~ msgid "In the eyes of the world"
     50  1.1  christos #~ msgstr "Fr die anderen"
     51  1.1  christos 
     52  1.1  christos # Etwas freie bersetzung.
     53  1.1  christos #~ msgid "You're just another crazy girl"
     54  1.1  christos #~ msgstr "bist du blo ein verrcktes dummes Ding"
     55  1.1  christos 
     56  1.1  christos #~ msgid "Who loves a married man"
     57  1.1  christos #~ msgstr "das einen verheirateten Mann liebt"
     58  1.1  christos EOF
     59  1.1  christos 
     60  1.1  christos tmpfiles="$tmpfiles mex-test1.sh"
     61  1.1  christos cat <<\EOF > mex-test1.sh
     62  1.1  christos #! /bin/sh
     63  1.1  christos echo "========================= $MSGEXEC_LOCATION ========================="
     64  1.1  christos cat <<MEOF
     65  1.1  christos $MSGEXEC_MSGID
     66  1.1  christos ---
     67  1.1  christos MEOF
     68  1.1  christos cat
     69  1.1  christos echo
     70  1.1  christos exit 0
     71  1.1  christos EOF
     72  1.1  christos chmod a+x mex-test1.sh
     73  1.1  christos 
     74  1.1  christos tmpfiles="$tmpfiles mex-test1.out"
     75  1.1  christos : ${MSGEXEC=msgexec}
     76  1.1  christos ${MSGEXEC} -i mex-test1.po ./mex-test1.sh > mex-test1.out
     77  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     78  1.1  christos 
     79  1.1  christos tmpfiles="$tmpfiles mex-test1.ok"
     80  1.1  christos cat <<\EOF > mex-test1.ok
     81  1.1  christos ========================= mex-test1.po:4 =========================
     82  1.1  christos 
     83  1.1  christos ---
     84  1.1  christos Project-Id-Version: Bonnie Tyler
     85  1.1  christos Content-Type: text/plain; charset=ISO-8859-1
     86  1.1  christos Content-Transfer-Encoding: 8bit
     87  1.1  christos 
     88  1.1  christos ========================= mex-test1.po:12 =========================
     89  1.1  christos The world is full of married men
     90  1.1  christos ---
     91  1.1  christos So viele verheiratete Mnner
     92  1.1  christos ========================= mex-test1.po:16 =========================
     93  1.1  christos with wives who never understand
     94  1.1  christos ---
     95  1.1  christos und ihre Frauen verstehen sie nicht
     96  1.1  christos ========================= mex-test1.po:20 =========================
     97  1.1  christos They're looking for someone to share
     98  1.1  christos ---
     99  1.1  christos 
    100  1.1  christos ========================= mex-test1.po:25 =========================
    101  1.1  christos the excitement of a love affair
    102  1.1  christos ---
    103  1.1  christos 
    104  1.1  christos ========================= mex-test1.po:29 =========================
    105  1.1  christos Just as soon as they find you
    106  1.1  christos ---
    107  1.1  christos 
    108  1.1  christos ========================= mex-test1.po:33 =========================
    109  1.1  christos They warn you and darn you
    110  1.1  christos ---
    111  1.1  christos 
    112  1.1  christos ========================= mex-test1.po:36 =========================
    113  1.1  christos You fly on the wings of romance
    114  1.1  christos ---
    115  1.1  christos Die Flgel der frischen Liebe
    116  1.1  christos heben dich zum Himmel
    117  1.1  christos ========================= mex-test1.po:41 =========================
    118  1.1  christos In the eyes of the world
    119  1.1  christos ---
    120  1.1  christos Fr die anderen
    121  1.1  christos ========================= mex-test1.po:45 =========================
    122  1.1  christos You're just another crazy girl
    123  1.1  christos ---
    124  1.1  christos bist du blo ein verrcktes dummes Ding
    125  1.1  christos ========================= mex-test1.po:48 =========================
    126  1.1  christos Who loves a married man
    127  1.1  christos ---
    128  1.1  christos das einen verheirateten Mann liebt
    129  1.1  christos EOF
    130  1.1  christos 
    131  1.1  christos : ${DIFF=diff}
    132  1.1  christos ${DIFF} mex-test1.ok mex-test1.out
    133  1.1  christos result=$?
    134  1.1  christos 
    135  1.1  christos rm -fr $tmpfiles
    136  1.1  christos 
    137  1.1  christos exit $result
    138