summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLucie Gérard <lucie.gerard@qt.io>2022-06-30 11:02:33 +0200
committerLucie Gerard <lucie.gerard@qt.io>2022-08-03 11:23:36 +0000
commit6a84f40204b03ffd8fa7c033af018f38927e2cf3 (patch)
tree3dfb58751138c80dcd4269141411773993033b10 /tests
parent1d71b888639c9beec0bdff92f56e79f06b1876ec (diff)
downloadqtqa-6a84f40204b03ffd8fa7c033af018f38927e2cf3.tar.gz
Add qtwebengine to license check
qtwebengine is excluded from license check if the repository is not SPDX compliant Task-number: QTBUG-104589 Change-Id: Ide62bd198bb4ceb947e2f1d432215c953b5719c2 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 263c49457487f2c5d533cb9c407dc0cf8011c484)
Diffstat (limited to 'tests')
-rwxr-xr-xtests/prebuild/license/tst_licenses.pl35
1 files changed, 21 insertions, 14 deletions
diff --git a/tests/prebuild/license/tst_licenses.pl b/tests/prebuild/license/tst_licenses.pl
index 43217ea..519b2b5 100755
--- a/tests/prebuild/license/tst_licenses.pl
+++ b/tests/prebuild/license/tst_licenses.pl
@@ -56,12 +56,14 @@ my %excludedModules = (
'qtrepotools' => [],
'qtwebkit' => [],
'test262' => [],
- 'qtwebengine' => [],
'3rdparty' => [],
'qtqa' => [],
'pyside-setup' => ['5.6']
);
+# These modules are excluded if the repository License Type is not SPDX
+my @SPDXonlyModules = ( "qtwebengine" );
+
# If you add to the following lists of regexes, please
# make the patterns as specific as possible to avoid excluding more files
# than intended -- for directories, add the leading and trailing /, and
@@ -698,8 +700,25 @@ sub run
# Remove possible 'tqtc-' prefix from the module name
substr($moduleName, 0, 5, "") if (index($moduleName,"tqtc-") == 0);
- # Skip the test (and return success) if we don't want to scan this module
+ # Check if we're dealing with a repository that has been ported to use SPDX.
+ if (-d "$QT_MODULE_TO_TEST/LICENSES") {
+ print "SPDX compliant repository detected.\n";
+ $repositoryLicenseType = 'SPDX';
+ # Store what's in the LICENSES directory.
+ foreach (glob "$QT_MODULE_TO_TEST/LICENSES/*.txt") {
+ my $id = basename($_);
+ $id =~ s/\.txt$//;
+ $licenseFiles{$id} = $_;
+ }
+ }
+ if (grep(/$moduleName/, @SPDXonlyModules) && $repositoryLicenseType ne "SPDX") {
+ plan skip_all => $moduleName .
+ ' is excluded from license checks (because it is not SPDX compliant)';
+ return;
+ }
+
+ # Skip the test (and return success) if we don't want to scan this module
if ($optForceTest == 0) {
my $excludedBranches = $excludedModules{$moduleName};
if (defined($excludedBranches)) {
@@ -718,18 +737,6 @@ sub run
}
}
- # Check if we're dealing with a repository that has been ported to use SPDX.
- if (-d "$QT_MODULE_TO_TEST/LICENSES") {
- print "SPDX compliant repository detected.\n";
- $repositoryLicenseType = 'SPDX';
-
- # Store what's in the LICENSES directory.
- foreach (glob "$QT_MODULE_TO_TEST/LICENSES/*.txt") {
- my $id = basename($_);
- $id =~ s/\.txt$//;
- $licenseFiles{$id} = $_;
- }
- }
#
# Phase 2: Read the reference license texts