Skip to content
Permalink
Browse files

[refFunctions] remove *_test functions and factor repeated code

# Conflicts:
#	src/core/expression/qgsexpressionfunction.cpp
  • Loading branch information
olivierdalang committed Aug 20, 2020
2 parents d4f8e2c + c8082b9 commit c738731aec158c9059479e871d8c69541c2c7942
Showing 3,725 changed files with 80,617 additions and 78,474 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -7,13 +7,13 @@ variables:
trigger:
branches:
include:
- master
# - master
- $(LR)
- $(LTR)
- azure-pipelines

pr:
- master
#- master
- $(LR)
- $(LTR)

@@ -0,0 +1,38 @@
FROM fedora:32
MAINTAINER Matthias Kuhn <matthias@opengis.ch>

RUN dnf -y install \
bison \
ccache \
clang \
clazy \
exiv2-devel \
fcgi-devel \
flex \
gdal-devel \
geos-devel \
gsl-devel \
libpq-devel \
libspatialite-devel \
libzip-devel \
ninja-build \
proj-devel \
protobuf-devel \
protobuf-lite-devel \
python3-pyqt5-sip \
python3-qscintilla-qt5 \
python3-qt5-devel \
qca-qt5-devel \
qscintilla-qt5-devel \
qt5-qt3d-devel \
qt5-qtbase-devel \
qt5-qtlocation-devel \
qt5-qtserialport-devel \
qt5-qttools-static \
qt5-qtwebkit-devel \
qtkeychain-qt5-devel \
qwt-qt5-devel \
spatialindex-devel \
sqlite-devel \
unzip

@@ -0,0 +1,39 @@
#!/bin/bash

mkdir /usr/src/qgis/build
cd /usr/src/qgis/build || exit -1

ccache -s

ln -s /../../bin/ccache /usr/lib64/ccache/clang
ln -s /../../bin/ccache /usr/lib64/ccache/clang++

cmake -GNinja \
-DWITH_QUICK=OFF \
-DWITH_3D=ON \
-DWITH_STAGED_PLUGINS=ON \
-DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON \
-DENABLE_MODELTEST=ON \
-DENABLE_PGTEST=ON \
-DENABLE_SAGA_TESTS=ON \
-DENABLE_MSSQLTEST=ON \
-DWITH_QSPATIALITE=OFF \
-DWITH_QWTPOLAR=OFF \
-DWITH_APIDOC=OFF \
-DWITH_ASTYLE=OFF \
-DWITH_DESKTOP=ON \
-DWITH_BINDINGS=ON \
-DWITH_SERVER=ON \
-DWITH_ORACLE=OFF \
-DDISABLE_DEPRECATED=ON \
-DCXX_EXTRA_FLAGS="${CLANG_WARNINGS}" \
-DCMAKE_C_COMPILER=/usr/lib64/ccache/clang \
-DCMAKE_CXX_COMPILER=/usr/lib64/ccache/clang++ \
-DADD_CLAZY_CHECKS=ON \
-DWERROR=TRUE \
..

ninja

ccache -s
@@ -9,6 +9,7 @@ exclude =
# There is simply too much in here, somebody will need to check these manually
src/plugins/grass/scripts,
# Generated code, hacking allowed. Feel free to go over it
python/3d/auto_additions/,
python/core/auto_additions/,
python/analysis/auto_additions/,
python/gui/auto_additions/,
@@ -13,7 +13,7 @@ by running the prepare commit script **before** issuing `git commit`.

This can be automated by setting up the pre-commit hook properly.

ln -s ../../scripts/prepare_commit.sh .git/hooks/pre-commit
ln -s $PWD/scripts/prepare_commit.sh ./.git/hooks/pre-commit

Getting your pull request merged
--------------------------------
@@ -4,6 +4,7 @@ on: [push, pull_request]

jobs:
flake8_py3:
name: Python Lint
runs-on: ubuntu-latest
steps:
- name: Setup Python
@@ -13,11 +14,9 @@ jobs:
architecture: x64
- name: Checkout
uses: actions/checkout@v2
- name: Install flake8
run: pip install flake8
- name: Run flake8
uses: suo/flake8-github-action@releases/v1
uses: julianwachholz/flake8-action@v1.0.0
with:
checkName: 'flake8_py3' # NOTE: this needs to be the same as the job name
checkName: 'Python Lint'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,34 @@
name: Build QGIS with Qt 5.14

on:
push:
branches:
- master
- release-**
pull_request:
branches:
- master
- release-**

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Setup build dependencies
run: |
docker build -t qgis_build_deps -f .ci/qt5_14/Dockerfile .
- name: Cache
id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: qt514

- name: Run build
run: |
docker run -v ~/.ccache:/root/ccache -v $(pwd):/usr/src/qgis qgis_build_deps /usr/src/qgis/.ci/qt5_14/build.sh
@@ -1,6 +1,6 @@
#############################################################
# CMake settings
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10.0)
SET(CMAKE_COLOR_MAKEFILE ON)
SET(CMAKE_AUTORCC ON)
# set path to additional CMake modules
@@ -571,7 +571,7 @@ IF (PEDANTIC)
# ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 -Wredundant-decls )

IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-overloaded-virtual -Wimplicit-fallthrough")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-overloaded-virtual -Wimplicit-fallthrough")
ENDIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

# add any extra CXXFLAGS flags set by user. can be -D CXX_EXTRA_FLAGS or environment variable
@@ -48,7 +48,7 @@ Following a summary of the required dependencies for building:

Required build tools:

* CMake >= 3.0.0
* CMake >= 3.10.0
* Flex >= 2.5.6
* Bison >= 2.4
* Python 3
@@ -47,13 +47,13 @@ ELSE(EXISTS PYQT5_VERSION)
ENDIF(pyqt_config)

IF(PYQT5_FOUND)
IF(NOT PYQT5_FIND_QUIETLY)
IF(NOT PyQt5_FIND_QUIETLY)
MESSAGE(STATUS "Found PyQt5 version: ${PYQT5_VERSION_STR}")
ENDIF(NOT PYQT5_FIND_QUIETLY)
ENDIF(NOT PyQt5_FIND_QUIETLY)
ELSE(PYQT5_FOUND)
IF(PYQT5_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Python")
ENDIF(PYQT5_FIND_REQUIRED)
IF(PyQt5_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find PyQt5")
ENDIF(PyQt5_FIND_REQUIRED)
ENDIF(PYQT5_FOUND)

ENDIF(EXISTS PYQT5_VERSION)
@@ -30,14 +30,13 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

try:
import PyQt5.pyqtconfig
import os.path
import PyQt5.QtCore

pyqtcfg = PyQt5.pyqtconfig.Configuration()
try:
__import__('sipbuild')
except ImportError:
import PyQt5.QtCore
import sipconfig # won't work for SIP v5
import os.path
import sys

cfg = sipconfig.Configuration()
@@ -52,36 +51,43 @@
if os.path.exists(os.path.join(p, "QtCore", "QtCoremod.sip")):
sip_dir = p
break
else:
sys.exit(1)
cfg = {
'pyqt_version': PyQt5.QtCore.PYQT_VERSION,
'pyqt_version_str': PyQt5.QtCore.PYQT_VERSION_STR,
'pyqt_sip_flags': PyQt5.QtCore.PYQT_CONFIGURATION['sip_flags'],
'pyqt_mod_dir': os.path.join(cfg.default_mod_dir, "PyQt5"),
'pyqt_sip_dir': sip_dir,
'pyqt_bin_dir': cfg.default_bin_dir,
}
pyqtcfg = sipconfig.Configuration([cfg])
else: # Code for SIP v5
from distutils.sysconfig import get_python_lib
import shutil
cfg = {
'pyqt_mod_dir': os.path.dirname(PyQt5.__file__),
'pyqt_sip_dir': os.path.join(get_python_lib(plat_specific=1), "PyQt5", "bindings"),
'pyqt_bin_dir': os.path.dirname(shutil.which("pyuic5")),
}

print("pyqt_version:%06.0x" % pyqtcfg.pyqt_version)
print("pyqt_version_num:%d" % pyqtcfg.pyqt_version)
print("pyqt_version_str:%s" % pyqtcfg.pyqt_version_str)
print("pyqt_version:%06.0x" % PyQt5.QtCore.PYQT_VERSION)
print("pyqt_version_num:%d" % PyQt5.QtCore.PYQT_VERSION)
print("pyqt_version_str:%s" % PyQt5.QtCore.PYQT_VERSION_STR)

pyqt_version_tag = ""
in_t = False
for item in pyqtcfg.pyqt_sip_flags.split(' '):
pyqt_config_list = PyQt5.QtCore.PYQT_CONFIGURATION["sip_flags"].split(' ')
for item in pyqt_config_list:
if item == "-t":
in_t = True
elif in_t:
if item.startswith("Qt_4"):
if item.startswith("Qt_5"):
pyqt_version_tag = item
else:
in_t = False
print("pyqt_version_tag:%s" % pyqt_version_tag)

print("pyqt_mod_dir:%s" % pyqtcfg.pyqt_mod_dir)
print("pyqt_sip_dir:%s" % pyqtcfg.pyqt_sip_dir)
print("pyqt_sip_flags:%s" % pyqtcfg.pyqt_sip_flags)
print("pyqt_bin_dir:%s" % pyqtcfg.pyqt_bin_dir)
print("pyqt_mod_dir:%s" % cfg['pyqt_mod_dir'])
print("pyqt_sip_dir:%s" % cfg['pyqt_sip_dir'])
print("pyqt_sip_flags:%s" % PyQt5.QtCore.PYQT_CONFIGURATION['sip_flags'])
print("pyqt_bin_dir:%s" % cfg['pyqt_bin_dir'])

try:
import PyQt5.sip
@@ -40,8 +40,12 @@ ELSE(SIP_VERSION)
STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_BINARY_PATH ${sip_config})
STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_module_dir:([^\n]+).*$" "\\1" SIP_MODULE_DIR ${sip_config})
IF(${SIP_VERSION_STR} VERSION_LESS 5)
STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_module_dir:([^\n]+).*$" "\\1" SIP_MODULE_DIR ${sip_config})
ELSE(${SIP_VERSION_STR} VERSION_LESS 5)
FIND_PROGRAM(SIP_MODULE_EXECUTABLE sip-module)
ENDIF(${SIP_VERSION_STR} VERSION_LESS 5)
SET(SIP_FOUND TRUE)
ENDIF(sip_config)

@@ -30,17 +30,31 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

import sipconfig
try:
import sipbuild
except ImportError: # Code for SIP v4
import sipconfig

sipcfg = sipconfig.Configuration()
print("sip_version:%06.0x" % sipcfg.sip_version)
print("sip_version_num:%d" % sipcfg.sip_version)
print("sip_version_str:%s" % sipcfg.sip_version_str)
print("sip_bin:%s" % sipcfg.sip_bin)
print("default_sip_dir:%s" % sipcfg.default_sip_dir)
print("sip_inc_dir:%s" % sipcfg.sip_inc_dir)
# SIP 4.19.10+ has new sipcfg.sip_module_dir
if hasattr(sipcfg, "sip_module_dir"):
print("sip_module_dir:%s" % sipcfg.sip_module_dir)
else:
print("sip_module_dir:%s" % sipcfg.sip_mod_dir)
sipcfg = sipconfig.Configuration()
print("sip_version:%06.0x" % sipcfg.sip_version)
print("sip_version_num:%d" % sipcfg.sip_version)
print("sip_version_str:%s" % sipcfg.sip_version_str)
print("sip_bin:%s" % sipcfg.sip_bin)
print("default_sip_dir:%s" % sipcfg.default_sip_dir)
print("sip_inc_dir:%s" % sipcfg.sip_inc_dir)
# SIP 4.19.10+ has new sipcfg.sip_module_dir
if hasattr(sipcfg, "sip_module_dir"):
print("sip_module_dir:%s" % sipcfg.sip_module_dir)
else:
print("sip_module_dir:%s" % sipcfg.sip_mod_dir)
else: # Code for SIP v5
print("sip_version:%06.0x" % sipbuild.version.SIP_VERSION)
print("sip_version_num:%d" % sipbuild.version.SIP_VERSION)
print("sip_version_str:%s" % sipbuild.version.SIP_VERSION_STR)

import shutil
print("sip_bin:%s" % shutil.which("sip5"))

from distutils.sysconfig import get_python_lib
python_modules_dir = get_python_lib(plat_specific=1)
print("default_sip_dir:%s" % python_modules_dir)
@@ -121,6 +121,12 @@ MACRO(GENERATE_SIP_PYTHON_MODULE_CODE MODULE_NAME MODULE_SIP SIP_FILES CPP_FILES
DEPENDS ${SIP_EXTRA_FILES_DEPEND}
VERBATIM
)
IF (SIP_MODULE_EXECUTABLE)
ADD_CUSTOM_COMMAND(
OUTPUT ${_sip_output_files} APPEND
COMMAND ${SIP_MODULE_EXECUTABLE} --target-dir ${CMAKE_CURRENT_BINARY_DIR}/${_module_path} --sip-h ${PYQT5_SIP_IMPORT}
)
ENDIF (SIP_MODULE_EXECUTABLE)

ADD_CUSTOM_TARGET(generate_sip_${MODULE_NAME}_cpp_files DEPENDS ${_sip_output_files})

@@ -114,9 +114,9 @@ Description: Geographic Information System (GIS)
Package: qgis-common
Architecture: all
Depends:
libjs-jquery,
libjs-leaflet,
${misc:Depends}
libjs-jquery,
libjs-leaflet,
${misc:Depends}
Description: QGIS - architecture-independent data
QGIS is a Geographic Information System (GIS) which manages, analyzes and
display databases of geographic information.

0 comments on commit c738731

Please sign in to comment.
You can’t perform that action at this time.