[geos-commits] [SCM] GEOS branch master updated. 177584e6af186769666bf022557c044548c757ff

git at osgeo.org git at osgeo.org
Fri Sep 27 02:31:57 PDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  177584e6af186769666bf022557c044548c757ff (commit)
       via  01488a3b6d28d5fd302c8f59777bdc191b62d10c (commit)
      from  76e23a266acf72314ae1c659f8c472ffd95262b4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 177584e6af186769666bf022557c044548c757ff
Merge: 01488a3 76e23a2
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Sep 27 05:28:39 2019 -0400

    Merge branch 'master' into add-cmake-doxygen-error-check


commit 01488a3b6d28d5fd302c8f59777bdc191b62d10c
Author: nila <n_larsson at yahoo.com>
Date:   Thu Sep 12 17:29:18 2019 +0200

    Add doxygen error test with CMake

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 0712355..9365381 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -28,14 +28,28 @@ if(BUILD_DOCUMENTATION)
 
     set(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
     set(VERSION ${GEOS_VERSION_FULL})
-    set(DOXYGEN_LOGFILE ${CMAKE_CURRENT_BINARY_DIR}/doxygen_log)
-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
-                   ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
-                   @ONLY)
+    set(DOXYGEN_LOGFILE ${CMAKE_CURRENT_BINARY_DIR}/doxygen.log)
+    set(CHECK_ERROR_SCRIPT "check_doxygen_errors.cmake")
+    configure_file(
+        "${CMAKE_CURRENT_SOURCE_DIR}/${CHECK_ERROR_SCRIPT}"
+        "${CMAKE_CURRENT_BINARY_DIR}/${CHECK_ERROR_SCRIPT}"
+        COPYONLY)
+    configure_file(
+        ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+        ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+        @ONLY)
     unset(srcdir)
     unset(VERSION)
-    unset(DOXYGEN_LOGFILE)
 
     add_custom_target(docs
-            COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+        COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+        BYPRODUCTS ${DOXYGEN_LOGFILE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen_docs)
+
+    add_test(NAME test_docs
+        COMMAND ${CMAKE_COMMAND}
+            -D DOXYGEN_LOGFILE="${DOXYGEN_LOGFILE}"
+            -P "${CMAKE_CURRENT_BINARY_DIR}/${CHECK_ERROR_SCRIPT}")
+
+    unset(DOXYGEN_LOGFILE)
+    unset(CHECK_ERROR_SCRIPT)
 endif()
diff --git a/doc/check_doxygen_errors.cmake b/doc/check_doxygen_errors.cmake
new file mode 100644
index 0000000..78a0c74
--- /dev/null
+++ b/doc/check_doxygen_errors.cmake
@@ -0,0 +1,50 @@
+################################################################################
+# Part of CMake configuration for GEOS
+#
+# Script checking the doxygen logfile for errors and warnings, which are not
+# accepted. Throws FATAL_ERROR if found.
+#
+# Copyright (C) 2019 Nicklas Larsson <n_larsson at yahoo.com>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation.
+# See the COPYING file for more information.
+################################################################################
+
+file(TO_NATIVE_PATH ${DOXYGEN_LOGFILE} DOXYGEN_LOGFILE)
+
+if(EXISTS "${DOXYGEN_LOGFILE}")
+  set(ERRORS "")
+  file(READ "${DOXYGEN_LOGFILE}" LOGFILE)
+
+  # convert file content to list
+  string(REGEX REPLACE "\n$" "" LOGFILE "${LOGFILE}")
+  string(REGEX REPLACE ";" "\\\\;" LOGFILE "${LOGFILE}")
+  string(REGEX REPLACE "\n" ";" LOGFILE "${LOGFILE}")
+
+  # let's not forget non-fatal warnings
+  list(LENGTH LOGFILE NUM_WARNINGS)
+  if(NUM_WARNINGS GREATER 0)
+    message(STATUS
+      "Doxygen issued ${NUM_WARNINGS} warning(s), see ${DOXYGEN_LOGFILE}")
+  endif()
+
+  foreach(LINE ${LOGFILE})
+    string(REGEX MATCH
+      ".*(not documented|ignoring unsupported tag).*" IGNORE ${LINE})
+    if("${IGNORE}" STREQUAL "")
+      list(APPEND ERRORS ${LINE})
+    endif()
+  endforeach()
+
+  if(NOT "${ERRORS}" STREQUAL "")
+    # convert list to string
+    string(REGEX REPLACE ";" "\n" ERROR_MSG "${ERRORS}")
+    message(FATAL_ERROR "${ERROR_MSG}")
+  endif()
+
+  unset(ERRORS)
+endif()
+
+message(STATUS "Doxygen documentation is OK")

-----------------------------------------------------------------------

Summary of changes:
 doc/CMakeLists.txt             | 26 +++++++++++++++++-----
 doc/check_doxygen_errors.cmake | 50 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 6 deletions(-)
 create mode 100644 doc/check_doxygen_errors.cmake


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list