Home | History | Annotate | Line # | Download | only in tests
msgcomm-1 revision 1.1.1.1
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test --more-than=0 option.
      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 mcomm-test1.in1 mcomm-test1.in2"
      9  1.1  christos cat <<EOF > mcomm-test1.in1
     10  1.1  christos #: first.c:123
     11  1.1  christos msgid "1"
     12  1.1  christos msgstr "1x"
     13  1.1  christos EOF
     14  1.1  christos 
     15  1.1  christos cat <<EOF > mcomm-test1.in2
     16  1.1  christos #: hunt.c:759
     17  1.1  christos msgid "2"
     18  1.1  christos msgstr "2x"
     19  1.1  christos EOF
     20  1.1  christos 
     21  1.1  christos tmpfiles="$tmpfiles mcomm-test1.out"
     22  1.1  christos : ${MSGCOMM=msgcomm}
     23  1.1  christos ${MSGCOMM} --more-than=0 -o mcomm-test1.out mcomm-test1.in1 mcomm-test1.in2
     24  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     25  1.1  christos 
     26  1.1  christos tmpfiles="$tmpfiles mcomm-test1.ok"
     27  1.1  christos cat << EOF > mcomm-test1.ok
     28  1.1  christos #: first.c:123
     29  1.1  christos msgid "1"
     30  1.1  christos msgstr "1x"
     31  1.1  christos 
     32  1.1  christos #: hunt.c:759
     33  1.1  christos msgid "2"
     34  1.1  christos msgstr "2x"
     35  1.1  christos EOF
     36  1.1  christos 
     37  1.1  christos : ${DIFF=diff}
     38  1.1  christos ${DIFF} mcomm-test1.ok mcomm-test1.out
     39  1.1  christos result=$?
     40  1.1  christos 
     41  1.1  christos rm -fr $tmpfiles
     42  1.1  christos 
     43  1.1  christos exit $result
     44