Commit a505e0dd authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

tst_licenses.pl: Add command line option -f to force usage of find()


This makes it possible to locally simulate a COIN run despite a
repository being present, which is relevant when working with
submodules.

Change-Id: I09047a715ca15077df2f536a1a6491db88350a16
Reviewed-by: default avatarSimon Hausmann <simon.hausmann@qt.io>
Reviewed-by: default avatarSimo Fält <simo.falt@theqtcompany.com>
No related merge requests found
Showing with 10 additions and 2 deletions
......@@ -39,6 +39,7 @@ use utf8;
use File::Find;
use File::Basename;
use File::Spec::Functions;
use Getopt::Long;
use Cwd qw( abs_path getcwd );
use List::Util qw( first );
use Test::More;
......@@ -49,7 +50,9 @@ tst_licenses.pl - verify that source files contain valid license headers
=head1 SYNOPSIS
perl ./tst_licenses.pl
perl ./tst_licenses.pl [OPTION]
-f Force usage of find() to create the list of instead of git ls-files
This test expects the environment variable QT_MODULE_TO_TEST to contain
the path to the Qt module to be tested.
......@@ -64,6 +67,7 @@ headers.
# specific configuration files.
my @moduleOptionalFiles;
my @moduleExcludedFiles;
my $optForceFind = 0;
# These modules are not expected to contain any files that need
# Qt license headers. They are entirely excluded from license checking.
......@@ -602,7 +606,7 @@ sub run
#
my @filesToScan;
if (-d "$QT_MODULE_TO_TEST/.git") {
if (!$optForceFind && -d "$QT_MODULE_TO_TEST/.git") {
# We're scanning a git repo, only examine files that git knows
my $oldpwd = getcwd();
if (!chdir $QT_MODULE_TO_TEST) {
......@@ -647,5 +651,9 @@ sub run
}
if (!GetOptions('f' => \$optForceFind)) {
exit (1);
}
run();
done_testing();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment