Skip to content

Commit

Permalink
Merge branch 'master' into 3nids-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored Dec 3, 2024
2 parents 688463e + a6946c6 commit 3cd4a06
Show file tree
Hide file tree
Showing 3,199 changed files with 238,540 additions and 153,197 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
96 changes: 53 additions & 43 deletions .ci/ctest2ci.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
***************************************************************************
Expand All @@ -18,51 +17,56 @@
***************************************************************************
"""

__author__ = 'Matthias Kuhn'
__date__ = 'March 2017'
__copyright__ = '(C) 2017, Matthias Kuhn'
__author__ = "Matthias Kuhn"
__date__ = "March 2017"
__copyright__ = "(C) 2017, Matthias Kuhn"

# This script parses output from ctest and injects
#
# - Colors for failing unit tests and test cases
# - Group control sequences to hide uninteresting output by default

import sys
import re
import string
import subprocess
import sys

from termcolor import colored
import string

fold_stack = list()
printable = set(string.printable)


def start_fold(tag):
sys.stdout.write('::group::{}\n'.format(tag))
sys.stdout.write(f"::group::{tag}\n")
fold_stack.append(tag)


def end_fold():
try:
tag = fold_stack.pop()
sys.stdout.write('::endgroup::\n')
sys.stdout.write("::endgroup::\n")
except IndexError:
updated_line = colored("======================", 'magenta')
updated_line += colored("ctest2ci error when processing the following line:", 'magenta')
updated_line += colored("----------------------", 'magenta')
updated_line += colored(updated_line, 'magenta')
updated_line += colored("----------------------", 'magenta')
updated_line += colored("Tried to end fold, but fold was never started.", 'magenta')
updated_line += colored("======================", 'magenta')
updated_line = colored("======================", "magenta")
updated_line += colored(
"ctest2ci error when processing the following line:", "magenta"
)
updated_line += colored("----------------------", "magenta")
updated_line += colored(updated_line, "magenta")
updated_line += colored("----------------------", "magenta")
updated_line += colored(
"Tried to end fold, but fold was never started.", "magenta"
)
updated_line += colored("======================", "magenta")


test_count = 0


def start_test_fold():
global test_count
sys.stdout.write('Running tests\n')
start_fold('test.{}'.format(test_count))
sys.stdout.write("Running tests\n")
start_fold(f"test.{test_count}")
test_count += 1


Expand All @@ -72,55 +76,61 @@ def start_test_fold():
p = subprocess.Popen(sys.argv[1:], stdout=subprocess.PIPE)

for line in p.stdout:
updated_line = line.decode('utf-8')
updated_line = line.decode("utf-8")
# remove non printable characters https://stackoverflow.com/a/8689826/1548052
filter(lambda x: x in printable, updated_line)
if re.match('Run dashboard with model Experimental', updated_line):
start_fold('Run tests')
updated_line = '{title}\n{line}'.format(title=colored('Running tests...', 'yellow', attrs=['bold']),
line=updated_line)

elif re.match('Test project /home/runner/QGIS/QGIS/build', updated_line):
if re.match("Run dashboard with model Experimental", updated_line):
start_fold("Run tests")
updated_line = "{title}\n{line}".format(
title=colored("Running tests...", "yellow", attrs=["bold"]),
line=updated_line,
)

elif re.match("Test project /home/runner/QGIS/QGIS/build", updated_line):
end_fold() # tag=Run tests
start_test_fold()

if re.search(r'\*\*\*Failed', updated_line) or re.search(r'\*\*\*Timeout', updated_line):
if re.search(r"\*\*\*Failed", updated_line) or re.search(
r"\*\*\*Timeout", updated_line
):
end_fold()
updated_line = colored(updated_line, 'red')
updated_line = colored(updated_line, "red")
in_failing_test = True

if in_failing_test:
if re.match(' Start', updated_line):
if re.match(" Start", updated_line):
start_test_fold()
in_failing_test = False
elif in_failure:
if re.match('PASS', updated_line) or re.match('Ran', updated_line):
if re.match("PASS", updated_line) or re.match("Ran", updated_line):
in_failure = False
else:
updated_line = colored(updated_line, 'yellow')
elif re.search(r'\*\*\* Segmentation fault', updated_line):
start_fold('segfault')
updated_line = colored(updated_line, 'magenta')
elif re.match(' Test failed: Segmentation fault', updated_line):
updated_line = colored(updated_line, "yellow")
elif re.search(r"\*\*\* Segmentation fault", updated_line):
start_fold("segfault")
updated_line = colored(updated_line, "magenta")
elif re.match(" Test failed: Segmentation fault", updated_line):
end_fold()

else:
if re.match(r'(FAIL|ERROR)[:\!].*', updated_line):
updated_line = colored(updated_line, 'yellow')
if re.match(r"(FAIL|ERROR)[:\!].*", updated_line):
updated_line = colored(updated_line, "yellow")
in_failure = True

if not in_failing_test and re.search('[0-9]+% tests passed, [0-9]+ tests failed out of', updated_line):
tests_failing = re.match(r'.* ([0-9]+) tests failed', updated_line).group(1)
if not in_failing_test and re.search(
"[0-9]+% tests passed, [0-9]+ tests failed out of", updated_line
):
tests_failing = re.match(r".* ([0-9]+) tests failed", updated_line).group(1)
# updated_line += '\n::set-output name=TESTS_FAILING::{}'.format(tests_failing)
end_fold()

if re.search('100% tests passed', updated_line):
updated_line = colored(updated_line, 'green')
if re.search("100% tests passed", updated_line):
updated_line = colored(updated_line, "green")

if re.match('Submit files', updated_line):
start_fold('submit')
elif re.search('Test results submitted to', updated_line):
cdash_url = re.match(r'.*(http.*)$', updated_line).group(1)
if re.match("Submit files", updated_line):
start_fold("submit")
elif re.search("Test results submitted to", updated_line):
cdash_url = re.match(r".*(http.*)$", updated_line).group(1)
# updated_line += '\n::set-output name=CDASH_URL::{}'.format(cdash_url)
end_fold()

Expand Down
3 changes: 3 additions & 0 deletions .ci/ogc/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ccache -M 2.0G
# export CCACHE_LOGFILE=/tmp/cache.debug
ccache -z

# To make ccache work properly with precompiled headers
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime

cmake -GNinja \
-DUSE_CCACHE=ON \
-DWITH_QUICK=OFF \
Expand Down
29 changes: 16 additions & 13 deletions .ci/pr_has_label.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
#!/usr/bin/env python3

import sys
import argparse
import json
from urllib.request import urlopen # using urllib since it is a standard module (vs. requests)
import sys

from urllib.error import URLError
import argparse
from urllib.request import ( # using urllib since it is a standard module (vs. requests)
urlopen,
)

parser = argparse.ArgumentParser(description='Determines if a pull request has a defined label')
parser.add_argument('pull_request', type=str,
help='pull request id')
parser.add_argument('label', type=int,
help='label ID')
parser = argparse.ArgumentParser(
description="Determines if a pull request has a defined label"
)
parser.add_argument("pull_request", type=str, help="pull request id")
parser.add_argument("label", type=int, help="label ID")

args = parser.parse_args()

if args.pull_request == 'false':
if args.pull_request == "false":
print("false")
sys.exit(1)

url = "https://api.github.com/repos/qgis/QGIS/pulls/{}".format(args.pull_request)
url = f"https://api.github.com/repos/qgis/QGIS/pulls/{args.pull_request}"

try:
data = urlopen(url).read().decode('utf-8')
data = urlopen(url).read().decode("utf-8")
except URLError as err:
print("URLError: {}".format(err.reason))
print(f"URLError: {err.reason}")
sys.exit(1)

obj = json.loads(data)

for label in obj['labels']:
for label in obj["labels"]:
if label["id"] == args.label:
print("true")
sys.exit(0)
Expand Down
4 changes: 0 additions & 4 deletions .ci/test_blocklist_qt6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ PyQgsProviderConnectionMssql
PyQgsStyleStorageMssql

# To be fixed
PyQgsPythonProvider
PyQgsAnnotation
PyQgsAuthenticationSystem
PyQgsBlockingProcess
Expand All @@ -47,13 +46,10 @@ PyQgsFloatingWidget
PyQgsLayoutHtml
PyQgsLineSymbolLayers
PyQgsMapBoxGlStyleConverter
PyQgsMemoryProvider
PyQgsNetworkAccessManager
PyQgsPalLabelingPlacement
PyQgsRasterAttributeTable
PyQgsRasterLayerRenderer
PyQgsShapefileProvider
PyQgsSpatialiteProvider
PyQgsSymbolLayerReadSld
PyQgsVectorLayerEditBuffer
PyQgsVectorLayerEditUtils
Expand Down
119 changes: 119 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: No
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IncludeCategories:
- Regex: '^<Q.*'
Priority: 300
- Regex: '^<qgs.*'
Priority: 200
- Regex: '<.*'
Priority: 400
- Regex: '^".*'
Priority: 100
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: false
IncludeBlocks: Regroup
IndentAccessModifiers: true
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
# Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between.
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 150
PenaltyBreakBeforeFirstCallParameter: 5000
PenaltyBreakComment: 500
PenaltyBreakFirstLessLess: 400
PenaltyBreakString: 600
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 5000
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: true
SpacesInParentheses: true
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 2
UseTab: Never

---

Language: ObjC

ObjCBlockIndentWidth: 4
Loading

0 comments on commit 3cd4a06

Please sign in to comment.