summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2016-09-13 14:31:38 -0400
committerNiko Tyni <ntyni@debian.org>2018-06-29 10:20:20 +0200
commit450ee25d79b4a628a9a0d48e2bd504e1e976ff96 (patch)
treea2dc71b0c6bba74e4ed3933fa98922e77960e7c6
parenta510c6630f5106b3842fd4883f97ba3f525f81ec (diff)
add $gpg_is_modern to test suite
MyTestSpecific.pm now produces a new variable indicating whether it the version of GnuPG we run against is from the "Modern" line of GnuPG development (2.1 or later). This will be useful when comparing output that we can't expect from earlier versions. Gbp-Pq: Name 0005-add-gpg_is_modern-to-test-suite.patch
-rw-r--r--t/MyTestSpecific.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/MyTestSpecific.pm b/t/MyTestSpecific.pm
index 1af98ae..a309698 100644
--- a/t/MyTestSpecific.pm
+++ b/t/MyTestSpecific.pm
@@ -29,17 +29,20 @@ use GnuPG::Handles;
use vars qw( @ISA @EXPORT
$stdin $stdout $stderr
$gpg_program $handles $gnupg
- %texts
+ %texts $gpg_is_modern
);
@ISA = qw( Exporter );
@EXPORT = qw( stdin stdout stderr
gnupg_program handles reset_handles
- texts file_match
+ texts file_match gpg_is_modern
);
$gnupg = GnuPG::Interface->new( passphrase => 'test' );
+my @version = split('\.', $gnupg->version());
+$gpg_is_modern = ($version[0] > 2 || ($version[0] == 2 && $version[1] >= 1));
+
$gnupg->options->hash_init( homedir => 'test/gnupghome',
armor => 1,
meta_interactive => 0,