summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-09-20 08:49:51 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-20 14:01:49 +0000
commitcf68d1384ff2630e6c4cd8a7998b779ca71be295 (patch)
treede7eecf3e1e13447d5bc7d37e687126ed2410736
parent3a67376605d33cb891f58259fb9490142359e447 (diff)
downloadqtqa-cf68d1384ff2630e6c4cd8a7998b779ca71be295.tar.gz
tst_license.pl: Fix test for excluded branches in CI
The test for excluded branches didn't work in the CI for Qt modules, because the source directories are no proper git repositories. Check first the CI environment variable TESTED_MODULE_BRANCH_COIN and the git branch as fallback. Change-Id: I30442b26c356422bc3f9a8d7950cb86887abdeea Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 293bc86c16c5f25ca30e0854836cb1f518f95577) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rwxr-xr-xtests/prebuild/license/tst_licenses.pl11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/prebuild/license/tst_licenses.pl b/tests/prebuild/license/tst_licenses.pl
index 3812d7f..6c5cf27 100755
--- a/tests/prebuild/license/tst_licenses.pl
+++ b/tests/prebuild/license/tst_licenses.pl
@@ -303,6 +303,15 @@ sub gitBranch
return '';
}
+sub moduleBranch
+{
+ my $branch = $ENV{TESTED_MODULE_BRANCH_COIN};
+ if (!defined($branch)) {
+ $branch = gitBranch();
+ }
+ return $branch;
+}
+
sub loadLicense {
my $licenseFile = shift;
@@ -751,7 +760,7 @@ sub run
my $excludedBranches = $excludedModules{$moduleName};
if (defined($excludedBranches)) {
if (scalar(@$excludedBranches) > 0) {
- my $branch = gitBranch();
+ my $branch = moduleBranch();
my $quotedBranch = quotemeta($branch);
if ($branch ne '' && grep(/$quotedBranch/, @$excludedBranches)) {
plan skip_all => 'Branch ' . $branch . ' of ' . $moduleName