No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-tcl-1
blob5424cb63658464f90d8afb581eae8b1647209191
1 #!/bin/sh
3 # Test of Tcl support.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-t-1.tcl"
9 cat <<\EOF > xg-t-1.tcl
10 #!/usr/bin/tclsh
12 proc isValid {target} {
13 global viScreenId
14 set address [valid $target]
15 # This comment is not extracted.
16 if {$address != 0} {
17 # First comment line.
19 # Second comment line.
20 viMsg $viScreenId [format [_ "%s is %s"] $target [string trim $address]]
21 } else {
22 viMsg $viScreenId [format [_ "%s not found"] $target]
25 EOF
27 tmpfiles="$tmpfiles xg-t-1.err xg-t-1.tmp xg-t-1.pot"
28 : ${XGETTEXT=xgettext}
29 ${XGETTEXT} --add-comments --no-location -k_ -o xg-t-1.tmp xg-t-1.tcl 2>xg-t-1.err
30 test $? = 0 || { cat xg-t-1.err; rm -fr $tmpfiles; exit 1; }
31 grep -v 'POT-Creation-Date' < xg-t-1.tmp > xg-t-1.pot
33 tmpfiles="$tmpfiles xg-t-1.ok"
34 cat <<\EOF > xg-t-1.ok
35 # SOME DESCRIPTIVE TITLE.
36 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
37 # This file is distributed under the same license as the PACKAGE package.
38 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
40 #, fuzzy
41 msgid ""
42 msgstr ""
43 "Project-Id-Version: PACKAGE VERSION\n"
44 "Report-Msgid-Bugs-To: \n"
45 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
46 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
47 "Language-Team: LANGUAGE <LL@li.org>\n"
48 "MIME-Version: 1.0\n"
49 "Content-Type: text/plain; charset=CHARSET\n"
50 "Content-Transfer-Encoding: 8bit\n"
52 #. First comment line.
53 #. Second comment line.
54 #, tcl-format
55 msgid "%s is %s"
56 msgstr ""
58 #, tcl-format
59 msgid "%s not found"
60 msgstr ""
61 EOF
63 : ${DIFF=diff}
64 ${DIFF} xg-t-1.ok xg-t-1.pot
65 result=$?
67 rm -fr $tmpfiles
69 exit $result