1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2013 Kornel Benko <kornel@lyx.org>
5 # (c) 2013 Scott Kostyshak <skotysh@lyx.org>
7 # Script should be called like:
8 # COMMAND ${CMAKE_COMMAND} \
9 # -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR} \
10 # -DLYX_USERDIR_VER=${LYX_USERDIR_VER} \
11 # -DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE} \
12 # -DPY_SCRIPT=${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py \
14 # -DTEX2LYX_EXE=$<TARGET_FILE:${_tex2lyx}> \
15 # -DSCRIPT_DIR=${TOP_SRC_DIR}/lib/scripts \
16 # -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR} \
18 # -P ${TOP_SRC_DIR}/src/tex2lyx/test/runtests.cmake
20 set(ENV{${LYX_USERDIR_VER}} ${LYX_TESTS_USERDIR})
21 message(STATUS "SCRIPT_DIR = ${SCRIPT_DIR}")
23 execute_process(COMMAND ${LYX_PYTHON_EXECUTABLE} ${PY_SCRIPT} ${FIRST_PARAM}
24 ${TEX2LYX_EXE} ${SCRIPT_DIR} ${WORKDIR} ${TESTFILE}
28 message(STATUS ${_out})
29 message(STATUS "Error output of ${PY_SCRIPT} = ${_err}")
30 string(COMPARE NOTEQUAL ${_err} 0 _erg)
33 message(FATAL_ERROR "${PY_SCRIPT} failed")