summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-05-04 16:25:21 +0200
committerGuillem Jover <guillem@debian.org>2014-05-17 13:30:52 +0200
commitfa48a94434acf00681259bbe8f7acb0efad76153 (patch)
tree98161a607f0e8ae7a698553571191a7e4e427669
parent79a6978160ccf752d058786ab8fb61ad7fa1646a (diff)
downloaddpkg-fa48a94434acf00681259bbe8f7acb0efad76153.tar.gz
scripts: Add template test cases for most modules
This at least tests if the module in question can be use'ed correctly, and gives a more realistic code coverage report. The remaining modules should be covered by one of their parents.
-rw-r--r--debian/changelog1
-rw-r--r--scripts/Makefile.am17
-rw-r--r--scripts/t/Dpkg_BuildEnv.t27
-rw-r--r--scripts/t/Dpkg_BuildFlags.t27
-rw-r--r--scripts/t/Dpkg_BuildProfiles.t27
-rw-r--r--scripts/t/Dpkg_Checksums.t27
-rw-r--r--scripts/t/Dpkg_Conf.t27
-rw-r--r--scripts/t/Dpkg_ErrorHandling.t27
-rw-r--r--scripts/t/Dpkg_Exit.t27
-rw-r--r--scripts/t/Dpkg_File.t27
-rw-r--r--scripts/t/Dpkg_Gettext.t27
-rw-r--r--scripts/t/Dpkg_Index.t27
-rw-r--r--scripts/t/Dpkg_Interface_Storable.t27
-rw-r--r--scripts/t/Dpkg_Source_Archive.t27
-rw-r--r--scripts/t/Dpkg_Source_Functions.t27
-rw-r--r--scripts/t/Dpkg_Source_Package.t27
-rw-r--r--scripts/t/Dpkg_Source_Patch.t27
-rw-r--r--scripts/t/Dpkg_Source_Quilt.t27
-rw-r--r--scripts/t/Dpkg_Vars.t27
19 files changed, 477 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index fe7241cfe..196409e77 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ dpkg (1.17.10) UNRELEASED; urgency=low
* Fix memory leaks in buffer_copy() on error conditions.
* Test suite:
- Improve C code coverage.
+ - Add template test cases for most perl modules.
* Fix non-security sensitive TOCTOU race in triggers database loading.
* Fix non-security sensitive TOCTOU race in update-alternative alternative
database loading.
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 45cb3d487..fc149a411 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -194,17 +194,34 @@ test_cases = \
t/Dpkg_Package.t \
t/Dpkg_Shlibs_Cppfilt.t \
t/Dpkg_Shlibs.t \
+ t/Dpkg_BuildEnv.t \
+ t/Dpkg_BuildFlags.t \
t/Dpkg_BuildOptions.t \
+ t/Dpkg_BuildProfiles.t \
+ t/Dpkg_Checksums.t \
+ t/Dpkg_ErrorHandling.t \
+ t/Dpkg_Exit.t \
+ t/Dpkg_File.t \
+ t/Dpkg_Gettext.t \
+ t/Dpkg_Conf.t \
t/Dpkg_Deps.t \
t/Dpkg_Path.t \
t/Dpkg_Util.t \
+ t/Dpkg_Vars.t \
+ t/Dpkg_Interface_Storable.t \
t/Dpkg_Vendor.t \
t/Dpkg_Changelog.t \
t/Dpkg_Changelog_Ubuntu.t \
t/Dpkg_Control.t \
+ t/Dpkg_Index.t \
t/Dpkg_Substvars.t \
t/Dpkg_IPC.t \
t/Dpkg_Compression.t \
+ t/Dpkg_Source_Functions.t \
+ t/Dpkg_Source_Patch.t \
+ t/Dpkg_Source_Quilt.t \
+ t/Dpkg_Source_Archive.t \
+ t/Dpkg_Source_Package.t \
t/Dpkg_Dist_Files.t \
t/merge_changelogs.t
diff --git a/scripts/t/Dpkg_BuildEnv.t b/scripts/t/Dpkg_BuildEnv.t
new file mode 100644
index 000000000..818ed8dda
--- /dev/null
+++ b/scripts/t/Dpkg_BuildEnv.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::BuildEnv');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_BuildFlags.t b/scripts/t/Dpkg_BuildFlags.t
new file mode 100644
index 000000000..e4aed94f3
--- /dev/null
+++ b/scripts/t/Dpkg_BuildFlags.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::BuildFlags');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_BuildProfiles.t b/scripts/t/Dpkg_BuildProfiles.t
new file mode 100644
index 000000000..bf7396a09
--- /dev/null
+++ b/scripts/t/Dpkg_BuildProfiles.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::BuildProfiles');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Checksums.t b/scripts/t/Dpkg_Checksums.t
new file mode 100644
index 000000000..9012abfc8
--- /dev/null
+++ b/scripts/t/Dpkg_Checksums.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Checksums');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Conf.t b/scripts/t/Dpkg_Conf.t
new file mode 100644
index 000000000..949fa2498
--- /dev/null
+++ b/scripts/t/Dpkg_Conf.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Conf');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_ErrorHandling.t b/scripts/t/Dpkg_ErrorHandling.t
new file mode 100644
index 000000000..7c2d128a9
--- /dev/null
+++ b/scripts/t/Dpkg_ErrorHandling.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::ErrorHandling');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Exit.t b/scripts/t/Dpkg_Exit.t
new file mode 100644
index 000000000..f1821c8b6
--- /dev/null
+++ b/scripts/t/Dpkg_Exit.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Exit');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_File.t b/scripts/t/Dpkg_File.t
new file mode 100644
index 000000000..1db6ee9f6
--- /dev/null
+++ b/scripts/t/Dpkg_File.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::File');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Gettext.t b/scripts/t/Dpkg_Gettext.t
new file mode 100644
index 000000000..c67e529ce
--- /dev/null
+++ b/scripts/t/Dpkg_Gettext.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Gettext');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Index.t b/scripts/t/Dpkg_Index.t
new file mode 100644
index 000000000..ffc24b4f6
--- /dev/null
+++ b/scripts/t/Dpkg_Index.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Index');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Interface_Storable.t b/scripts/t/Dpkg_Interface_Storable.t
new file mode 100644
index 000000000..117350d07
--- /dev/null
+++ b/scripts/t/Dpkg_Interface_Storable.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Interface::Storable');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Source_Archive.t b/scripts/t/Dpkg_Source_Archive.t
new file mode 100644
index 000000000..7b70da68e
--- /dev/null
+++ b/scripts/t/Dpkg_Source_Archive.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Source::Archive');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Source_Functions.t b/scripts/t/Dpkg_Source_Functions.t
new file mode 100644
index 000000000..003d2dfd0
--- /dev/null
+++ b/scripts/t/Dpkg_Source_Functions.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Source::Functions');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Source_Package.t b/scripts/t/Dpkg_Source_Package.t
new file mode 100644
index 000000000..dd2769920
--- /dev/null
+++ b/scripts/t/Dpkg_Source_Package.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Source::Package');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Source_Patch.t b/scripts/t/Dpkg_Source_Patch.t
new file mode 100644
index 000000000..21be6b1d4
--- /dev/null
+++ b/scripts/t/Dpkg_Source_Patch.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Source::Patch');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Source_Quilt.t b/scripts/t/Dpkg_Source_Quilt.t
new file mode 100644
index 000000000..ae0f4da78
--- /dev/null
+++ b/scripts/t/Dpkg_Source_Quilt.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Source::Quilt');
+}
+
+# TODO: Add actual test cases.
+
+1;
diff --git a/scripts/t/Dpkg_Vars.t b/scripts/t/Dpkg_Vars.t
new file mode 100644
index 000000000..132ca09f5
--- /dev/null
+++ b/scripts/t/Dpkg_Vars.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok('Dpkg::Vars');
+}
+
+# TODO: Add actual test cases.
+
+1;