1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 01:16:12 +02:00

Merge branch 'jk/perl-warning'

Dev support.

* jk/perl-warning:
  perl: check for perl warnings while running tests
This commit is contained in:
Junio C Hamano 2020-11-09 14:06:25 -08:00
commit 65681e75c1
22 changed files with 30 additions and 19 deletions

View File

@ -2767,6 +2767,9 @@ ifdef GIT_INTEROP_MAKE_OPTS
endif endif
ifdef GIT_TEST_INDEX_VERSION ifdef GIT_TEST_INDEX_VERSION
@echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+ @echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+
endif
ifdef GIT_TEST_PERL_FATAL_WARNINGS
@echo GIT_TEST_PERL_FATAL_WARNINGS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_PERL_FATAL_WARNINGS)))'\' >>$@+
endif endif
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi

View File

@ -46,3 +46,5 @@ ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
DEVELOPER_CFLAGS += -Wno-uninitialized DEVELOPER_CFLAGS += -Wno-uninitialized
endif endif
endif endif
GIT_TEST_PERL_FATAL_WARNINGS = YesPlease

View File

@ -2,7 +2,7 @@
# Copyright (C) 2006, Eric Wong <normalperson@yhbt.net> # Copyright (C) 2006, Eric Wong <normalperson@yhbt.net>
# License: GPL v2 or later # License: GPL v2 or later
use 5.008; use 5.008;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use strict; use strict;
use vars qw/ $AUTHOR $VERSION use vars qw/ $AUTHOR $VERSION
$oid $oid_short $oid_length $oid $oid_short $oid_length

View File

@ -12,7 +12,7 @@
package Error; package Error;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use vars qw($VERSION); use vars qw($VERSION);
use 5.004; use 5.004;

View File

@ -9,7 +9,7 @@ package Git;
use 5.008; use 5.008;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use File::Temp (); use File::Temp ();
use File::Spec (); use File::Spec ();

View File

@ -1,7 +1,7 @@
package Git::I18N; package Git::I18N;
use 5.008; use 5.008;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
BEGIN { BEGIN {
require Exporter; require Exporter;
if ($] < 5.008003) { if ($] < 5.008003) {

View File

@ -1,6 +1,6 @@
package Git::IndexInfo; package Git::IndexInfo;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Git qw/command_input_pipe command_close_pipe/; use Git qw/command_input_pipe command_close_pipe/;
sub new { sub new {

View File

@ -1,7 +1,7 @@
package Git::LoadCPAN; package Git::LoadCPAN;
use 5.008; use 5.008;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
=head1 NAME =head1 NAME

View File

@ -1,7 +1,7 @@
package Git::LoadCPAN::Error; package Git::LoadCPAN::Error;
use 5.008; use 5.008;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Git::LoadCPAN ( use Git::LoadCPAN (
module => 'Error', module => 'Error',
import => 1, import => 1,

View File

@ -1,7 +1,7 @@
package Git::LoadCPAN::Mail::Address; package Git::LoadCPAN::Mail::Address;
use 5.008; use 5.008;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Git::LoadCPAN ( use Git::LoadCPAN (
module => 'Mail::Address', module => 'Mail::Address',
import => 0, import => 0,

View File

@ -1,7 +1,7 @@
package Git::Packet; package Git::Packet;
use 5.008; use 5.008;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
BEGIN { BEGIN {
require Exporter; require Exporter;
if ($] < 5.008003) { if ($] < 5.008003) {

View File

@ -1,6 +1,6 @@
package Git::SVN; package Git::SVN;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Fcntl qw/:DEFAULT :seek/; use Fcntl qw/:DEFAULT :seek/;
use constant rev_map_fmt => 'NH*'; use constant rev_map_fmt => 'NH*';
use vars qw/$_no_metadata use vars qw/$_no_metadata

View File

@ -1,7 +1,7 @@
package Git::SVN::Editor; package Git::SVN::Editor;
use vars qw/@ISA $_rmdir $_cp_similarity $_find_copies_harder $_rename_limit/; use vars qw/@ISA $_rmdir $_cp_similarity $_find_copies_harder $_rename_limit/;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use SVN::Core; use SVN::Core;
use SVN::Delta; use SVN::Delta;
use Carp qw/croak/; use Carp qw/croak/;

View File

@ -3,7 +3,7 @@ package Git::SVN::Fetcher;
$_placeholder_filename @deleted_gpath %added_placeholder $_placeholder_filename @deleted_gpath %added_placeholder
$repo_id/; $repo_id/;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use SVN::Delta; use SVN::Delta;
use Carp qw/croak/; use Carp qw/croak/;
use File::Basename qw/dirname/; use File::Basename qw/dirname/;

View File

@ -1,6 +1,6 @@
package Git::SVN::GlobSpec; package Git::SVN::GlobSpec;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
sub new { sub new {
my ($class, $glob, $pattern_ok) = @_; my ($class, $glob, $pattern_ok) = @_;

View File

@ -1,6 +1,6 @@
package Git::SVN::Log; package Git::SVN::Log;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Git::SVN::Utils qw(fatal); use Git::SVN::Utils qw(fatal);
use Git qw(command use Git qw(command
command_oneline command_oneline

View File

@ -1,5 +1,5 @@
package Git::SVN::Memoize::YAML; package Git::SVN::Memoize::YAML;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use strict; use strict;
use YAML::Any (); use YAML::Any ();

View File

@ -33,7 +33,7 @@ package Git::SVN::Migration;
# possible if noMetadata or useSvmProps are set; but should # possible if noMetadata or useSvmProps are set; but should
# be no problem for users that use the (sensible) defaults. # be no problem for users that use the (sensible) defaults.
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Carp qw/croak/; use Carp qw/croak/;
use File::Path qw/mkpath/; use File::Path qw/mkpath/;
use File::Basename qw/dirname basename/; use File::Basename qw/dirname basename/;

View File

@ -1,6 +1,6 @@
package Git::SVN::Prompt; package Git::SVN::Prompt;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
require SVN::Core; require SVN::Core;
use vars qw/$_no_auth_cache $_username/; use vars qw/$_no_auth_cache $_username/;

View File

@ -1,7 +1,7 @@
package Git::SVN::Ra; package Git::SVN::Ra;
use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/; use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Memoize; use Memoize;
use Git::SVN::Utils qw( use Git::SVN::Utils qw(
canonicalize_url canonicalize_url

View File

@ -1,7 +1,7 @@
package Git::SVN::Utils; package Git::SVN::Utils;
use strict; use strict;
use warnings; use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use SVN::Core; use SVN::Core;

View File

@ -499,6 +499,12 @@ then
export GIT_INDEX_VERSION export GIT_INDEX_VERSION
fi fi
if test -n "$GIT_TEST_PERL_FATAL_WARNINGS"
then
GIT_PERL_FATAL_WARNINGS=1
export GIT_PERL_FATAL_WARNINGS
fi
# Add libc MALLOC and MALLOC_PERTURB test # Add libc MALLOC and MALLOC_PERTURB test
# only if we are not executing the test with valgrind # only if we are not executing the test with valgrind
if test -n "$valgrind" || if test -n "$valgrind" ||