Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / gettext-5
index bb76a5d..a7af65e 100755 (executable)
@@ -1,11 +1,9 @@
 #! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test that on glibc systems, the gettext() results come out in the correct
 # encoding for locales that differ only in their encoding.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
 # This test works only on glibc systems.
 : ${GLIBC2=no}
 test "$GLIBC2" = yes || {
@@ -15,7 +13,7 @@ test "$GLIBC2" = yes || {
 
 # This test works only on systems that have a de_DE.ISO-8859-1 and
 # de_DE.UTF-8 locale installed.
-LC_ALL=de_DE.ISO-8859-1 ./testlocale || {
+LC_ALL=de_DE.ISO-8859-1 ../testlocale || {
   if test -f /usr/bin/localedef; then
     echo "Skipping test: locale de_DE.ISO-8859-1 not installed"
   else
@@ -23,7 +21,7 @@ LC_ALL=de_DE.ISO-8859-1 ./testlocale || {
   fi
   exit 77
 }
-LC_ALL=de_DE.UTF-8 ./testlocale || {
+LC_ALL=de_DE.UTF-8 ../testlocale || {
   if test -f /usr/bin/localedef; then
     echo "Skipping test: locale de_DE.UTF-8 not installed"
   else
@@ -32,16 +30,13 @@ LC_ALL=de_DE.UTF-8 ./testlocale || {
   exit 77
 }
 
-tmpfiles="$tmpfiles gt-5"
 test -d gt-5 || mkdir gt-5
 test -d gt-5/de_DE || mkdir gt-5/de_DE
 test -d gt-5/de_DE/LC_MESSAGES || mkdir gt-5/de_DE/LC_MESSAGES
 
 : ${MSGFMT=msgfmt}
-${MSGFMT} -o gt-5/de_DE/LC_MESSAGES/codeset.mo ${top_srcdir}/tests/gettext-5.po
-
-./gettext-5-prg || exit 1
+${MSGFMT} -o gt-5/de_DE/LC_MESSAGES/codeset.mo "$abs_srcdir"/gettext-5.po
 
-rm -fr $tmpfiles
+../gettext-5-prg || exit 1
 
 exit 0