run code_layout build from top CMakeLists

instead of adding an extra CMakeLists in .ci/travis/code_layout to build API doc, astyle and run tests (indentation, spelling, sip, doc coverage), the top CMakeLists has been adapted to allow not building core libraries and possibly just the static code layout
* astyle has been moved from /src/astyle to /lib/astyle (I would propose to move all external libraries, and possibly add git submodules)
This commit is contained in:
Denis Rouzaud 2017-06-02 21:39:44 +02:00
parent c8555c3efb
commit fa5bd491fc
35 changed files with 610 additions and 604 deletions

View File

@ -1,28 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../../../cmake ${CMAKE_MODULE_PATH})
ADD_SUBDIRECTORY(../../../src/astyle qgisstyle)
ENABLE_TESTING()
ADD_TEST(qgis_indentation ${CMAKE_SOURCE_DIR}/../../../scripts/verify-indentation.sh)
ADD_TEST(qgis_spelling ${CMAKE_SOURCE_DIR}/../../../scripts/spell_check/spell_test.sh)
ADD_TEST(qgis_sipify ${CMAKE_SOURCE_DIR}/../../../tests/scripts/test_sipify.sh)
ADD_TEST(qgis_sip_uptodate ${CMAKE_SOURCE_DIR}/../../../tests/scripts/test_sipfiles_uptodate.sh)
IF (WITH_APIDOC)
ADD_SUBDIRECTORY(../../../doc doc)
INCLUDE(CreateQgsVersion)
CREATE_QGSVERSION()
set(QGIS_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc")
INCLUDE(UsePythonTest)
ADD_PYTHON_TEST(PyQgsDocCoverage ${CMAKE_SOURCE_DIR}/../../../tests/src/python/test_qgsdoccoverage.py)
ENDIF (WITH_APIDOC)

View File

@ -18,5 +18,5 @@ export CORES=2
mkdir build
cd build
cmake -DWITH_APIDOC=ON ../.ci/travis/code_layout
cmake -DWITH_CORE=OFF -DWITH_APIDOC=ON -DWITH_ASTYLE=ON -DENABLE_TESTS=ON ..
make -j${CORES}

View File

@ -14,10 +14,6 @@
###########################################################################
set -e
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
export QGISSTYLE=${DIR}/scripts/qgisstyle
pushd build
xvfb-run ctest -V --output-on-failure
popd

View File

@ -11,6 +11,8 @@ PyQgsDBManagerGpkg
# layout tests are run on separate build
qgis_indentation
qgis_spelling
qgis_sipify
qgis_sip_uptodate
# flacky
qgis_filedownloader

View File

@ -1,4 +1,8 @@
# layout tests are run on separate build
qgis_spelling
qgis_sipify
qgis_sip_uptodate
qgis_openstreetmaptest
qgis_wcsprovidertest
PyQgsServer
@ -49,4 +53,4 @@ PyQgsFileDownloader
PyQgsSettings
PyQgsConsole
PyQgsLocator
PyQgsAuthManagerPasswordOWSTest
PyQgsAuthManagerPasswordOWSTest

1
.gitignore vendored
View File

@ -21,7 +21,6 @@
.pydevproject
/CMakeLists.txt.user
/CMakeLists.txt.user.*
.ci/travis/code_layout/scripts/qgisstyle*
api_doc
build*
debian/*.debhelper

File diff suppressed because it is too large Load Diff

View File

@ -1133,7 +1133,7 @@ HTML_STYLESHEET =
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/api_custom.css
HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/doc/api_custom.css
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note

3
debian/copyright vendored
View File

@ -182,7 +182,7 @@ Files: src/app/qtmain_android.cpp
Copyright: 2009-2011, BogDan Vatra <bog_dan_ro@yahoo.com>
License: BSD-3-Clause
Files: src/astyle/*
Files: external/astyle/*
Copyright: Jim Pattee <jimp03@email.com>
Tal Davidson
Comment: Artistic Style is maintained and updated by Jim Pattee.
@ -2343,4 +2343,3 @@ License: Zlib
misrepresented as being the original software.
.
3. This notice may not be removed or altered from any source distribution.

View File

@ -18,7 +18,7 @@ IF(TXT2TAGS_EXECUTABLE)
ADD_CUSTOM_TARGET (t2tdoc ALL DEPENDS ${QGIS_DOC_FILES})
ELSE(TXT2TAGS_EXECUTABLE)
SET(QGIS_DOC_FILES
${CMAKE_CURRENT_SOURCE_DIR}/../INSTALL
${CMAKE_SOURCE_DIR}/INSTALL
)
ENDIF(TXT2TAGS_EXECUTABLE)
@ -46,65 +46,65 @@ IF(WITH_APIDOC)
ENDIF(GENERATE_QHP)
SET(DOXYGEN_INCLUDE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/../src/core
${CMAKE_SOURCE_DIR}/src/core
)
STRING(REPLACE ";" " " DOXYGEN_INCLUDE_PATH "${DOXYGEN_INCLUDE_PATH}")
SET(DOXYGEN_INPUT
${CMAKE_CURRENT_SOURCE_DIR}/../doc
${CMAKE_CURRENT_SOURCE_DIR}/../src/core
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/annotations
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/auth
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/composer
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/diagram
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/dxf
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/effects
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/fieldformatter
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/geometry
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/gps
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/layertree
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/metadata
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/pal
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/processing
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/providers
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/providers/memory
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/raster
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/scalebar
${CMAKE_CURRENT_SOURCE_DIR}/../src/core/symbology-ng
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/auth
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/attributetable
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/editorwidgets
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/editorwidgets/core
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/effects
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/layertree
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/locator
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/raster
${CMAKE_CURRENT_SOURCE_DIR}/../src/gui/symbology-ng
${CMAKE_CURRENT_SOURCE_DIR}/../src/analysis
${CMAKE_CURRENT_SOURCE_DIR}/../src/analysis/interpolation
${CMAKE_CURRENT_SOURCE_DIR}/../src/analysis/network
${CMAKE_CURRENT_SOURCE_DIR}/../src/analysis/openstreetmap
${CMAKE_CURRENT_SOURCE_DIR}/../src/analysis/raster
${CMAKE_CURRENT_SOURCE_DIR}/../src/analysis/vector
${CMAKE_CURRENT_SOURCE_DIR}/../src/plugins
${CMAKE_SOURCE_DIR}/doc
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/annotations
${CMAKE_SOURCE_DIR}/src/core/auth
${CMAKE_SOURCE_DIR}/src/core/composer
${CMAKE_SOURCE_DIR}/src/core/diagram
${CMAKE_SOURCE_DIR}/src/core/dxf
${CMAKE_SOURCE_DIR}/src/core/effects
${CMAKE_SOURCE_DIR}/src/core/fieldformatter
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/gps
${CMAKE_SOURCE_DIR}/src/core/layertree
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/pal
${CMAKE_SOURCE_DIR}/src/core/processing
${CMAKE_SOURCE_DIR}/src/core/providers
${CMAKE_SOURCE_DIR}/src/core/providers/memory
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/attributetable
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
${CMAKE_SOURCE_DIR}/src/gui/effects
${CMAKE_SOURCE_DIR}/src/gui/layertree
${CMAKE_SOURCE_DIR}/src/gui/locator
${CMAKE_SOURCE_DIR}/src/gui/raster
${CMAKE_SOURCE_DIR}/src/gui/symbology-ng
${CMAKE_SOURCE_DIR}/src/analysis
${CMAKE_SOURCE_DIR}/src/analysis/interpolation
${CMAKE_SOURCE_DIR}/src/analysis/network
${CMAKE_SOURCE_DIR}/src/analysis/openstreetmap
${CMAKE_SOURCE_DIR}/src/analysis/raster
${CMAKE_SOURCE_DIR}/src/analysis/vector
${CMAKE_SOURCE_DIR}/src/plugins
)
IF(WITH_SERVER_PLUGINS)
SET(DOXYGEN_INPUT
${DOXYGEN_INPUT}
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsserver.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgscapabilitiescache.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsserverexception.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsrequesthandler.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsserverfilter.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsaccesscontrolfilter.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsserverinterface.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsserverrequest.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsserverresponse.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsserverrequest.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsservice.h
${CMAKE_CURRENT_SOURCE_DIR}/../src/server/qgsserviceregistry.h
${CMAKE_SOURCE_DIR}/src/server/qgsserver.h
${CMAKE_SOURCE_DIR}/src/server/qgscapabilitiescache.h
${CMAKE_SOURCE_DIR}/src/server/qgsserverexception.h
${CMAKE_SOURCE_DIR}/src/server/qgsrequesthandler.h
${CMAKE_SOURCE_DIR}/src/server/qgsserverfilter.h
${CMAKE_SOURCE_DIR}/src/server/qgsaccesscontrolfilter.h
${CMAKE_SOURCE_DIR}/src/server/qgsserverinterface.h
${CMAKE_SOURCE_DIR}/src/server/qgsserverrequest.h
${CMAKE_SOURCE_DIR}/src/server/qgsserverresponse.h
${CMAKE_SOURCE_DIR}/src/server/qgsserverrequest.h
${CMAKE_SOURCE_DIR}/src/server/qgsservice.h
${CMAKE_SOURCE_DIR}/src/server/qgsserviceregistry.h
)
ENDIF(WITH_SERVER_PLUGINS)
@ -120,7 +120,7 @@ IF(WITH_APIDOC)
STRING(REPLACE ";" " " DOXYGEN_INPUT "${DOXYGEN_INPUT}")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../cmake_templates/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake_templates/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
SET (DOXYGEN_ON_DEMAND FALSE CACHE BOOL "Determines whether the QGIS API doxygen documentation should be build on demand only")

View File

@ -43,7 +43,7 @@ for i in $FILES; do
author=volayaf
;;
src/app/gps/qwtpolar-*|src/app/qtmain_android.cpp|src/core/gps/qextserialport/*|src/astyle/*|python/pyspatialite/*)
src/app/gps/qwtpolar-*|src/app/qtmain_android.cpp|src/core/gps/qextserialport/*|lib/astyle/*|python/pyspatialite/*)
# Skip third party files
echo $f skipped
continue

View File

@ -24,7 +24,7 @@ done
if [ -z "$ASTYLE" ]; then
echo "qgisstyle not found - please enable WITH_ASTYLE in cmake and build it" >&2
exit 1
exit 1
fi
if type -p tput >/dev/null; then
@ -72,7 +72,7 @@ astyleit() {
for f in "$@"; do
case "$f" in
src/app/gps/qwtpolar-*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/ext-libs/*|src/providers/spatialite/qspatialite/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*|python/ext-libs/*|*/ui_*.py|*.astyle|tests/testdata/*|editors/*)
src/app/gps/qwtpolar-*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|external/astyle/*|python/ext-libs/*|src/providers/spatialite/qspatialite/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*|python/ext-libs/*|*/ui_*.py|*.astyle|tests/testdata/*|editors/*)
echo -ne "$f skipped $elcr"
continue
;;

View File

@ -5,12 +5,12 @@ debian/build.*/
debian/build*/
debian/.*/usr/
i18n/
lib/astyle
ms-windows/osgeo4w/
python/ext-libs/
python/plugins/processing/algs/otb/
python/plugins/processing/algs/saga/
python/qsci_apis/
src/astyle
src/app/gps/qwtpolar-1.0/
src/app/gps/qwtpolar-1.1.1/
src/core/pal

View File

@ -57,7 +57,7 @@ ASTYLEDIFF=astyle.r$REV0-r$REV1.diff
# reformat
for f in $MODIFIED; do
case "$f" in
src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/pyspatialite/*)
src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|external/astyle/*|python/pyspatialite/*)
echo $f skipped
continue
;;

View File

@ -27,6 +27,3 @@ IF (WITH_CUSTOM_WIDGETS)
ADD_SUBDIRECTORY(customwidgets)
ENDIF (WITH_CUSTOM_WIDGETS)
IF (WITH_ASTYLE)
ADD_SUBDIRECTORY(astyle)
ENDIF(WITH_ASTYLE)

View File

@ -1,10 +1,11 @@
IF (ENABLE_TESTS)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(bench)
IF (WITH_CORE)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(bench)
ENDIF (WITH_CORE)
ADD_SUBDIRECTORY(code_layout)
ENDIF (ENABLE_TESTS)
IF(WITH_ASTYLE)
ADD_TEST(qgis_indentation ${CMAKE_SOURCE_DIR}/scripts/verify-indentation.sh)
ENDIF(WITH_ASTYLE)
ADD_TEST(qgis_spelling ${CMAKE_SOURCE_DIR}/scripts/spell_check/spell_test.sh)

View File

@ -0,0 +1,16 @@
IF(WITH_ASTYLE)
ADD_TEST(qgis_indentation ${CMAKE_SOURCE_DIR}/scripts/verify-indentation.sh)
ENDIF(WITH_ASTYLE)
ADD_TEST(qgis_spelling ${CMAKE_SOURCE_DIR}/scripts/spell_check/spell_test.sh)
ADD_TEST(qgis_sipify ${CMAKE_SOURCE_DIR}/tests/code_layout/test_sipify.sh)
ADD_TEST(qgis_sip_uptodate ${CMAKE_SOURCE_DIR}/tests/code_layout/test_sipfiles_uptodate.sh)
IF (WITH_APIDOC)
INCLUDE(UsePythonTest)
ADD_PYTHON_TEST(PyQgsDocCoverage ${CMAKE_SOURCE_DIR}/tests/code_layout/test_qgsdoccoverage.py)
IF (WITH_CORE)
ADD_PYTHON_TEST(PyQgsSipCoverage ${CMAKE_SOURCE_DIR}/tests/code_layout/test_qgssipcoverage.py)
ENDIF(WITH_CORE)
ENDIF (WITH_APIDOC)

View File

@ -1,7 +1,7 @@
/************************************************************************
* This file has been generated automatically from *
* *
* tests/scripts/sipifyheader.h *
* tests/code_layout/sipifyheader.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@ -442,7 +442,7 @@ class TemplateInheritance5 : SomethingElse
/************************************************************************
* This file has been generated automatically from *
* *
* tests/scripts/sipifyheader.h *
* tests/code_layout/sipifyheader.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -5,7 +5,7 @@
DIR=$(git rev-parse --show-toplevel)
pushd ${DIR} > /dev/null
outdiff=$(./scripts/sipify.pl tests/scripts/sipifyheader.h | diff tests/scripts/sipifyheader.expected.sip -)
outdiff=$(./scripts/sipify.pl tests/code_layout/sipifyheader.h | diff tests/code_layout/sipifyheader.expected.sip -)
popd > /dev/null
if [[ $outdiff ]]; then

View File

@ -190,11 +190,6 @@ IF (ENABLE_ORACLETEST)
ADD_PYTHON_TEST(PyQgsOracleProvider test_provider_oracle.py)
ENDIF (ENABLE_ORACLETEST)
IF (WITH_APIDOC)
ADD_PYTHON_TEST(PyQgsDocCoverage test_qgsdoccoverage.py)
ADD_PYTHON_TEST(PyQgsSipCoverage test_qgssipcoverage.py)
ENDIF (WITH_APIDOC)
IF (WITH_SERVER)
ADD_PYTHON_TEST(PyQgsServer test_qgsserver.py)
ADD_PYTHON_TEST(PyQgsServerPlugins test_qgsserver_plugins.py)