summaryrefslogtreecommitdiff
path: root/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0005-add-gpg_is_modern-to-test-suite.patch
blob: 0016fa755c0c38de634b351bf732e0ca3c5f6f67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Tue, 13 Sep 2016 14:31:38 -0400
Subject: 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.
---
 t/MyTestSpecific.pm | 7 +++++--
 1 file 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,