Package: licensecheck
Version: 3.3.9-1
Severity: minor
Tags: patch
Fedora's RPM macros provide a macro %make_build which
expands to "make -O -j4 V=1 VERBOSE=1". If licensecheck's
test suite is invoked with these options, it will fail as
the VERBOSE environment variable causes
Log::Any::Adapter::Screen to include more logging in the
output than the test suite expects.
The attached patch fixes this by unsetting the environment
variables NO_COLOR, COLOR, LOG_PREFIX, LOG_LEVEL, QUIET,
VERBOSE, DEBUG and TRACE before testing licensecheck.
diff --git a/t/20-script-encoding.t b/t/20-script-encoding.t
index 495abba..9494808 100644
--- a/t/20-script-encoding.t
+++ b/t/20-script-encoding.t
@@ -30,6 +30,9 @@ elsif ( path('blib')->exists ) {
@Test2::Tools::Command::command = ('blib/script/licensecheck');
}
push @Test2::Tools::Command::command, qw(--machine --debug --copyright);
+delete (@ENV {'NO_COLOR', 'COLOR',
+ 'LOG_PREFIX', 'LOG_LEVEL',
+ 'QUIET', 'VERBOSE', 'DEBUG', 'TRACE'});
my $basic
= "t/encoding/copr-utf8.h\tGNU General Public License v2.0 or later\t2004-2015 Oliva 'f00' Oberto / 2001-2010 Paul 'bar' Stevénsön\n";
diff --git a/t/20-script-report.t b/t/20-script-report.t
index 645ca17..bc327fd 100644
--- a/t/20-script-report.t
+++ b/t/20-script-report.t
@@ -14,6 +14,9 @@ elsif ( path('blib')->exists ) {
@CMD = ('blib/script/licensecheck');
}
local @Test2::Tools::Command::command = @CMD;
+delete (@ENV {'NO_COLOR', 'COLOR',
+ 'LOG_PREFIX', 'LOG_LEVEL',
+ 'QUIET', 'VERBOSE', 'DEBUG', 'TRACE'});
subtest 'machine-readable output; short-form option' => sub {
command {
diff --git a/t/20-script-resolve.t b/t/20-script-resolve.t
index f9b033b..2854356 100644
--- a/t/20-script-resolve.t
+++ b/t/20-script-resolve.t
@@ -14,6 +14,9 @@ elsif ( path('blib')->exists ) {
@CMD = ('blib/script/licensecheck');
}
local @Test2::Tools::Command::command = @CMD;
+delete (@ENV {'NO_COLOR', 'COLOR',
+ 'LOG_PREFIX', 'LOG_LEVEL',
+ 'QUIET', 'VERBOSE', 'DEBUG', 'TRACE'});
subtest '--help, ignoring earlier --list-licenses' => sub {
my ( $result, $exit_status, $stdout_ref, $stderr_ref ) = command {