]> git.lyx.org Git - lyx.git/blob - development/autotests/CheckLoadErrors.cmake
ctests: log a waste and a success
[lyx.git] / development / autotests / CheckLoadErrors.cmake
1
2 macro(CheckLoadErrors lyxerrx PARAMS_DIR res_erg)
3   set(lyxerr ${${lyxerrx}})
4   set(_erg 0)
5   if(lyxerr)
6     set(ConfigureOutput 0)
7     set(DocumentClassNotAvailable 0)
8     file(STRINGS "${PARAMS_DIR}/filterCheckWarnings" ignoreRegexp)
9     # Split lyxerr into lines
10     string(REGEX REPLACE "[\n]+" ";" foundErrors ${lyxerr})
11     foreach(_l ${foundErrors})
12       if(ConfigureOutput)
13         if(_l MATCHES "LyX: Done!")
14           set(ConfigureOutput 0)
15         endif()
16       elseif(DocumentClassNotAvailable)
17         if(_l MATCHES "User's Guide for more information.")
18           set(DocumentClassNotAvailable 0)
19         endif()
20       else()
21         if(_l MATCHES "reconfiguring user directory")
22           set(ConfigureOutput 1)
23         elseif(_l MATCHES "Warning: Document class not available")
24           set(DocumentClassNotAvailable 1)
25         else()
26           # here neither ConfigureOutput nor DocumentClassNotAvailable is set
27           # so we can scan for other warnings/errors
28           set(found 0)
29           foreach(_r ${ignoreRegexp})
30             if(_l MATCHES "${_r}")
31               set(found 1)
32               break()
33             endif()
34           endforeach()
35           if(NOT found)
36             message(STATUS "Error line = ${_l}")
37             # It is error, because the error-line does not match
38             # any ignoring expression
39             set(_erg 1)
40           endif()
41         endif()
42       endif()
43     endforeach()
44   endif()
45   set(${res_erg} ${_erg})
46 endmacro()