From a505e0dd27e8abea19aa817494bacf3500638adf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 11 Oct 2016 16:54:35 +0200 Subject: tst_licenses.pl: Add command line option -f to force usage of find() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Simo Fält --- tests/prebuild/license/tst_licenses.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests') 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(); -- cgit v1.2.3