diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-10-11 16:54:35 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-10-25 06:39:53 +0000 |
commit | a505e0dd27e8abea19aa817494bacf3500638adf (patch) | |
tree | 5ac81e538c1aefa7754d5c2bce5da19064be5cb9 /tests | |
parent | b09a66ab5e8fae6f57187426a02eb251fbb3bf89 (diff) |
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: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Simo Fält <simo.falt@theqtcompany.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/prebuild/license/tst_licenses.pl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/prebuild/license/tst_licenses.pl b/tests/prebuild/license/tst_licenses.pl index 3a0f99b3..9b69c809 100755 --- a/tests/prebuild/license/tst_licenses.pl +++ b/tests/prebuild/license/tst_licenses.pl @@ -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(); |