[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.10-90-ge1d71f0



The following commit has been merged in the master branch:
commit e1d71f00d82337b52ad5cfddfc93cc2f7b3a6bbe
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Jul 23 23:42:17 2012 +0200

    t: Add test for various debconf template issues
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/t/COVERAGE b/t/COVERAGE
index 58d293f..b3cd903 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,5 +1,5 @@
-Last generated 2012-07-22
-Coverage (Tags): 843/962 (87.63%), w. legacy tests: 935/962 (97.19%)
+Last generated 2012-07-23
+Coverage (Tags): 855/962 (88.88%), w. legacy tests: 943/962 (98.02%)
 Coverage (Checks): 32/41 (78.05%), w. legacy tests: 35/41 (85.37%)
 
 The following tags are not tested by the test suite:
@@ -7,16 +7,8 @@ The following tags are not tested by the test suite:
 binaries binary-file-compressed-with-upx
 binaries ocaml-custom-executable
 
-debconf boolean-template-has-bogus-default
 debconf debconf-is-not-a-registry
-debconf duplicate-long-description-in-template
-debconf empty-translated-choices
 debconf isdefault-flag-is-deprecated
-debconf malformed-template-name
-debconf no-template-name
-debconf select-without-choices
-debconf unknown-field-in-templates
-debconf unknown-template-type
 
 files debug-package-should-be-named-dbg
 files udeb-contains-documentation-file
@@ -52,17 +44,13 @@ debconf making-assumptions-about-interfaces-in-templates
 debconf malformed-prompt-in-templates
 debconf malformed-question-in-templates
 debconf malformed-title-in-templates
-debconf mismatch-translated-choices
 debconf missing-debconf-dependency
 debconf missing-debconf-dependency-for-preinst
 debconf no-debconf-templates
-debconf no-template-description
-debconf no-template-type
 debconf possible-debconf-note-abuse
 debconf postinst-does-not-load-confmodule
 debconf postinst-uses-db-input
 debconf postrm-does-not-purge-debconf
-debconf select-with-boolean-choices
 debconf template-uses-unsplit-choices
 debconf too-long-extended-description-in-templates
 debconf too-long-short-description-in-templates
@@ -182,16 +170,12 @@ debconf
   malformed-prompt-in-templates
   malformed-question-in-templates
   malformed-title-in-templates
-  mismatch-translated-choices
   missing-debconf-dependency
   missing-debconf-dependency-for-preinst
   newer-debconf-templates
-  no-template-description
-  no-template-type
   possible-debconf-note-abuse
   postinst-uses-db-input
   postrm-does-not-purge-debconf
-  select-with-boolean-choices
   template-uses-unsplit-choices
   too-long-extended-description-in-templates
   too-long-short-description-in-templates
diff --git a/t/tests/debconf-templates-general/debian/config-gen.pl b/t/tests/debconf-templates-general/debian/config-gen.pl
new file mode 100644
index 0000000..c93484f
--- /dev/null
+++ b/t/tests/debconf-templates-general/debian/config-gen.pl
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+# Helper script to generate d/config from d/templates.
+# It is just here to make sure all templates are "used".
+
+use strict;
+use warnings;
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Lintian::Util qw(visit_dpkg_paragraph :constants);
+
+print <<EOF ;
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+EOF
+
+visit_dpkg_paragraph (\&pg, \*STDIN, DCTRL_DEBCONF_TEMPLATE);
+
+exit 0;
+
+sub pg {
+    my ($paragraph) = @_;
+    my $template = $paragraph->{'template'};
+    # Some of them will not have a name, so skip those.
+    return unless $template;
+    print "db_input medium $template || true\n";
+    print "db_go\n\n";
+}
diff --git a/t/tests/debconf-templates-general/debian/debian/po/POTFILES.in b/t/tests/debconf-templates-general/debian/debian/po/POTFILES.in
new file mode 100644
index 0000000..cef83a3
--- /dev/null
+++ b/t/tests/debconf-templates-general/debian/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates
diff --git a/t/tests/debconf-templates-general/debian/debian/po/da.po b/t/tests/debconf-templates-general/debian/debian/po/da.po
new file mode 100644
index 0000000..e7cceb3
--- /dev/null
+++ b/t/tests/debconf-templates-general/debian/debian/po/da.po
@@ -0,0 +1,24 @@
+# Danish translations for PACKAGE package.
+# Copyright (C) 2012 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Niels Thykier <niels@thykier.net>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-07-23 23:07+0200\n"
+"PO-Revision-Date: 2012-07-23 23:08+0200\n"
+"Last-Translator: Niels Thykier <niels@thykier.net>\n"
+"Language-Team: Danish\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. Type: error
+#. Description
+#: ../templates:1001
+msgid "Useless note"
+msgstr "Ubrugelig note"
diff --git a/t/tests/scripts-control-interpreters/debian/debian/po/templates.pot b/t/tests/debconf-templates-general/debian/debian/po/templates.pot
similarity index 76%
copy from t/tests/scripts-control-interpreters/debian/debian/po/templates.pot
copy to t/tests/debconf-templates-general/debian/debian/po/templates.pot
index 6b4af20..3edd4a9 100644
--- a/t/tests/scripts-control-interpreters/debian/debian/po/templates.pot
+++ b/t/tests/debconf-templates-general/debian/debian/po/templates.pot
@@ -8,16 +8,17 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-12-28 14:30-0800\n"
+"POT-Creation-Date: 2012-07-23 23:07+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#. Type: string
-#. description
-#: ../scripts-control-interpreters-forbidden.templates:1001
-msgid "Enter something:"
+#. Type: error
+#. Description
+#: ../templates:1001
+msgid "Useless note"
 msgstr ""
diff --git a/t/tests/debconf-syntax-error/debian/debian/postinst b/t/tests/debconf-templates-general/debian/debian/postinst
similarity index 100%
copy from t/tests/debconf-syntax-error/debian/debian/postinst
copy to t/tests/debconf-templates-general/debian/debian/postinst
diff --git a/t/tests/debconf-templates-general/debian/debian/templates b/t/tests/debconf-templates-general/debian/debian/templates
new file mode 100644
index 0000000..87563ed
--- /dev/null
+++ b/t/tests/debconf-templates-general/debian/debian/templates
@@ -0,0 +1,52 @@
+Template: debconf/translated
+Type: error
+_Description: Useless note
+
+Type: text
+Description: Missing template field.
+
+Template: debconf-malformed-template
+Type: boolean
+Description: Is this a bad template?
+
+Template: debconf/no-type
+Description: Missing type
+
+Template: debconf/unknown-type
+Type: lintian
+Description: Template with unknown type
+
+Template: debconf/boolean-bogus-default
+Type: boolean
+Default: lintian
+Description: How do you like the default?
+ On a scale of "false" to "true".
+
+Template: debconf/select-boolean-choice
+Type: select
+Choices: yes, no
+Description: A boolean type would have been better
+
+Template: debconf/select-empty-trans-choices
+Type: select
+Choices: sakana, sake
+Choices-Da:
+Description: Preference
+
+Template: debconf/select-without-choices
+Type: select
+Description: Missing a Choices field
+
+Template: debconf/no-description
+Type: error
+
+Template: debconf/duplicate-long-desc
+Type: error
+Description: Duplicate long description
+ Duplicate long description
+
+Template: debconf/unknown-field
+Type: boolean
+Description: Is the field below unknown?
+Unknown-field: yes, it is.
+
diff --git a/t/tests/debconf-templates-general/debian/gen-source.mk b/t/tests/debconf-templates-general/debian/gen-source.mk
new file mode 100755
index 0000000..f6f5975
--- /dev/null
+++ b/t/tests/debconf-templates-general/debian/gen-source.mk
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+all: debian/config
+
+debian/config: debian/templates
+	perl config-gen.pl < $< > $@
+
+
diff --git a/t/tests/debconf-templates-general/desc b/t/tests/debconf-templates-general/desc
new file mode 100644
index 0000000..ed5eb7d
--- /dev/null
+++ b/t/tests/debconf-templates-general/desc
@@ -0,0 +1,17 @@
+Testname: debconf-templates-general
+Sequence: 6000
+Version: 1.0
+Description: Test for various debconf template issues
+Test-For:
+ boolean-template-has-bogus-default
+ duplicate-long-description-in-template
+ empty-translated-choices
+ malformed-template-name
+ mismatch-translated-choices
+ no-template-description
+ no-template-name
+ no-template-type
+ select-with-boolean-choices
+ select-without-choices
+ unknown-field-in-templates
+ unknown-template-type
diff --git a/t/tests/debconf-templates-general/pre_build b/t/tests/debconf-templates-general/pre_build
new file mode 100755
index 0000000..bfcb477
--- /dev/null
+++ b/t/tests/debconf-templates-general/pre_build
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+DIR="$1"
+make --silent -C "$DIR" -f "$DIR/gen-source.mk" all
diff --git a/t/tests/debconf-templates-general/tags b/t/tests/debconf-templates-general/tags
new file mode 100644
index 0000000..5d286b0
--- /dev/null
+++ b/t/tests/debconf-templates-general/tags
@@ -0,0 +1,12 @@
+E: debconf-templates-general: boolean-template-has-bogus-default debconf/boolean-bogus-default lintian
+E: debconf-templates-general: empty-translated-choices debconf/select-empty-trans-choices choices-da
+E: debconf-templates-general: malformed-template-name debconf-malformed-template
+E: debconf-templates-general: mismatch-translated-choices debconf/select-empty-trans-choices choices-da
+E: debconf-templates-general: no-template-description debconf/no-description
+E: debconf-templates-general: no-template-name
+E: debconf-templates-general: no-template-type debconf/no-type
+E: debconf-templates-general: select-without-choices debconf/select-without-choices
+E: debconf-templates-general: unknown-field-in-templates debconf/unknown-field unknown-field
+E: debconf-templates-general: unknown-template-type lintian
+W: debconf-templates-general: duplicate-long-description-in-template debconf/duplicate-long-desc
+W: debconf-templates-general: select-with-boolean-choices debconf/select-boolean-choice

-- 
Debian package checker


Reply to: