diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-05-08 15:22:30 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-05-22 11:37:11 +0000 |
commit | f6a5dfc9ad67cf353e230578cf3201514f01674a (patch) | |
tree | 88ca0c7c9e305da49bef7d297d4abe326cf972a1 /scripts/t | |
parent | 91b42fec5b66068515118fbb422a74d179e35ff2 (diff) |
Remove dependency on git for running the tests
If we cannot find a .git directory (like in the new CI system), then fall back
to finding existing files, similar to the fallback in tst_licenses.pl.
Change-Id: Ie8abc0d1f21dfc1f8d38612c1ea0e0af79580f8c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'scripts/t')
-rw-r--r-- | scripts/t/QtQA/PerlChecks.pm | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/scripts/t/QtQA/PerlChecks.pm b/scripts/t/QtQA/PerlChecks.pm index ba2e2477..ab9d36aa 100644 --- a/scripts/t/QtQA/PerlChecks.pm +++ b/scripts/t/QtQA/PerlChecks.pm @@ -41,6 +41,7 @@ our @EXPORT_OK = qw( all_files_in_git all_perl_files_in_git ); use File::chdir; use File::Spec::Functions; +use File::Find; use List::MoreUtils qw( apply ); use Perl::Critic::Utils qw( all_perl_files ); use Test::More; @@ -60,11 +61,21 @@ sub all_files_in_git # Do everything from $path, so we get filenames relative to that local $CWD = $path; + my $QT_MODULE_TO_TEST=$ENV{QT_MODULE_TO_TEST}; + # Find all the files known to git - my @out = - apply { canonpath } # make paths canonical ... - apply { chomp } # strip all newlines ... - qx( git ls-files ); + my @out; + if (-d $QT_MODULE_TO_TEST . '/.git') { + @out = + apply { canonpath } # make paths canonical ... + apply { chomp } # strip all newlines ... + qx( git ls-files ); + } else { + find(sub{ push @out, canonpath($File::Find::name); }, "."); + } + foreach (@out) { + print "$_\n"; + } # Get files in a reliable order @out = sort @out; |