summaryrefslogtreecommitdiff
path: root/tools/ctest_scripts
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-05-09 15:28:09 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-05-09 20:46:16 +0200
commitd4e54e9f35d532062533f1d369c159810b01d224 (patch)
tree7046ff72a41a8b0ad2e40e1d4aa3b191d03f6380 /tools/ctest_scripts
parent8650b70e06408d394c1708846b6fc2d86cf14079 (diff)
Add mechanisms to reformant and check code style (#128)
Use an internal version of astyle (astyle 3.0). Scripts taken from QGIS. astyle.options from https://github.com/uclouvain/openjpeg/issues/128 scripts/prepare-commit.sh can be used locally to automatically reformat edited files. Travis-CI will run scripts/verify-indentation.sh to verify committed files.
Diffstat (limited to 'tools/ctest_scripts')
-rw-r--r--tools/ctest_scripts/travis-ci.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake
index f8c50e5b..f1e78952 100644
--- a/tools/ctest_scripts/travis-ci.cmake
+++ b/tools/ctest_scripts/travis-ci.cmake
@@ -91,6 +91,13 @@ else()
set(BUILD_TESTING "FALSE")
endif(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1")
+
+if("$ENV{OPJ_CI_CHECK_STYLE}" STREQUAL "1")
+ set(BUILD_ASTYLE "TRUE")
+else()
+ set(BUILD_ASTYLE "FALSE")
+endif("$ENV{OPJ_CI_CHECK_STYLE}" STREQUAL "1")
+
# Options
set( CACHE_CONTENTS "
@@ -100,6 +107,9 @@ CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}
# Warning level
CMAKE_C_FLAGS:STRING= ${CCFLAGS_ARCH} ${CCFLAGS_WARNING}
+# For astyle
+CMAKE_CXX_FLAGS:STRING= ${CCFLAGS_ARCH}
+
# Use to activate the test suite
BUILD_TESTING:BOOL=${BUILD_TESTING}
@@ -112,6 +122,8 @@ OPJ_DATA_ROOT:PATH=$ENV{PWD}/data
# jpylyzer is available with on GitHub: https://github.com/openpreserve/jpylyzer
JPYLYZER_EXECUTABLE=$ENV{PWD}/jpylyzer/jpylyzer.${JPYLYZER_EXT}
+# Enable astyle
+WITH_ASTYLE:BOOL=${BUILD_ASTYLE}
" )
#---------------------