[Reproducible-commits] [dpkg] 64/74: test: Add unit tests for dependency simplification with build profiles
Mattia Rizzolo
mattia at debian.org
Sun Jul 3 22:22:58 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to annotated tag 1.18.8
in repository dpkg.
commit 883453e9f5fb746816912adee8a0e32bb370433e
Author: Guillem Jover <guillem at debian.org>
Date: Mon Jun 20 02:24:22 2016 +0200
test: Add unit tests for dependency simplification with build profiles
---
debian/changelog | 1 +
scripts/t/Dpkg_Deps.t | 23 ++++++++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 09c5a13..3651820 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -82,6 +82,7 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
- Accept perl's Lancaster Consensus AUTHOR_TESTING variable.
- Add new minimum perl version unit test.
- Add new synopsis unit test.
+ - Add unit tests for dependency simplification with build profiles.
* Documentation:
- Improve dpkg-buildpackage(1) on environment expectations.
- Clarify the format of the db:Status-Abbrev virtual field in
diff --git a/scripts/t/Dpkg_Deps.t b/scripts/t/Dpkg_Deps.t
index 4302099..bb16ba2 100644
--- a/scripts/t/Dpkg_Deps.t
+++ b/scripts/t/Dpkg_Deps.t
@@ -16,7 +16,7 @@
use strict;
use warnings;
-use Test::More tests => 58;
+use Test::More tests => 62;
use Dpkg::Arch qw(get_host_arch);
use Dpkg::Version;
@@ -197,6 +197,27 @@ $dep_red->simplify_deps($facts, $dep_opposite);
is($dep_red->output(), 'abc, two', 'Simplification respect order');
is("$dep_red", $dep_red->output(), 'Stringification == output()');
+my $dep_profiles = deps_parse('dupe <stage1 cross>, dupe <stage1 cross>');
+$dep_profiles->simplify_deps($facts);
+is($dep_profiles->output(), 'dupe <stage1 cross>',
+ 'Simplification respects duplicated profiles');
+
+$dep_profiles = deps_parse('tool <!cross>, tool <stage1 cross>');
+$dep_profiles->simplify_deps($facts);
+# XXX: Ideally this would get simplified to "tool <!cross> <stage1 cross>".
+is($dep_profiles->output(), 'tool <!cross>, tool <stage1 cross>',
+ 'Simplification respects profiles');
+
+$dep_profiles = deps_parse('libfoo-dev:native <!stage1>, libfoo-dev <!stage1 cross>', build_dep => 1);
+$dep_profiles->simplify_deps($facts);
+is($dep_profiles->output(),
+ 'libfoo-dev:native <!stage1>, libfoo-dev <!stage1 cross>',
+ 'Simplification respects archqualifiers and profiles');
+
+my $dep_version = deps_parse('pkg, pkg (= 1.0)');
+$dep_version->simplify_deps($facts);
+is($dep_version->output(), 'pkg (= 1.0)', 'Simplification merges versions');
+
my $dep_empty1 = deps_parse('');
is($dep_empty1->output(), '', 'Empty dependency');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list