]> git.lyx.org Git - lyx.git/blob - src/tests/check_layout.cmake
Account for old versions of Pygments
[lyx.git] / src / tests / check_layout.cmake
1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
3 #
4 # Copyright (c) 2017 Kornel Benko kornel@lyx.org
5
6 # Should be called like
7 # cmake -DCheckLayout=$<TARGET_FILE:check_layout>
8 #       -DModule="${LYX_TESTS_USERDIR}/layouts/test${bn}"
9 #       -DOutput="${CMAKE_CURRENT_BINARY_DIR}/${bn}.out${_checktype}"
10 #       -P "${TOP_SRC_DIR}/src/tests/check_layout.cmake"
11
12 execute_process(COMMAND ${CheckLayout} ${Module} ${Output}
13                    OUTPUT_VARIABLE _out
14                    ERROR_VARIABLE _err
15                    RESULT_VARIABLE _erg)
16 #message(STATUS "_out = \"${_out}\"")
17 string(COMPARE EQUAL ${_erg} 0 _erg1)
18 if(NOT _erg1)
19   message(STATUS "_erg = \"${_erg}\"")
20   message(FATAL_ERROR "${CheckLayout} failed")
21 endif()
22 if (_err MATCHES "Error reading")
23   message(STATUS "_err = \"${_err}\"")
24   message(FATAL_ERROR "Errors found")
25 endif()
26