Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-tcl-1
index 373729a..645e19a 100755 (executable)
@@ -1,11 +1,8 @@
 #!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
 
 # Test of Tcl support.
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-t-1.tcl"
 cat <<\EOF > xg-t-1.tcl
 #!/usr/bin/tclsh
 
@@ -24,15 +21,13 @@ proc isValid {target} {
 }
 EOF
 
-tmpfiles="$tmpfiles xg-t-1.err xg-t-1.tmp xg-t-1.pot"
 : ${XGETTEXT=xgettext}
 ${XGETTEXT} --add-comments --no-location -k_ -o xg-t-1.tmp xg-t-1.tcl 2>xg-t-1.err
-test $? = 0 || { cat xg-t-1.err; rm -fr $tmpfiles; exit 1; }
+test $? = 0 || { cat xg-t-1.err; exit 1; }
 # Don't simplify this to "grep ... < xg-t-1.tmp", otherwise OpenBSD 4.0 grep
 # only outputs "Binary file (standard input) matches".
 cat xg-t-1.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-t-1.pot
 
-tmpfiles="$tmpfiles xg-t-1.ok"
 cat <<\EOF > xg-t-1.ok
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
@@ -67,6 +62,4 @@ EOF
 ${DIFF} xg-t-1.ok xg-t-1.pot
 result=$?
 
-rm -fr $tmpfiles
-
 exit $result