X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Ftest%2FCMakeLists.txt;h=71626c23b0a16e7c3a56338b2739a3e85f1aee88;hb=9960709fc25756cce248d39ba9c99f1089d3e020;hp=365d953f69bacb3e7c2ab1a74ebae8385b77d6ed;hpb=f7680c696d3b62cbd289ff255a6d636eab7e096c;p=lyx.git diff --git a/src/tex2lyx/test/CMakeLists.txt b/src/tex2lyx/test/CMakeLists.txt index 365d953f69..71626c23b0 100644 --- a/src/tex2lyx/test/CMakeLists.txt +++ b/src/tex2lyx/test/CMakeLists.txt @@ -6,43 +6,67 @@ project(test) -set(_test_depend "test.ltx") -set(_test_output) - -foreach(_arg test-structure test-insets box-color-size-space-align CJK XeTeX-polyglossia) - list(APPEND _test_depend "${TOP_SRC_DIR}/src/tex2lyx/test/${_arg}.tex") - list(APPEND _test_output "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.lyx.tex") - list(APPEND _test_output "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.lyx.lyx") -endforeach(_arg) - -ADD_CUSTOM_COMMAND( - OUTPUT ${_test_output} - COMMAND ${LYX_PYTHON_EXECUTABLE} - ARGS "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py" - "${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${_tex2lyx}" - "${TOP_SRC_DIR}/lib/scripts" - "${CMAKE_CURRENT_BINARY_DIR}" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - DEPENDS ${_tex2lyx} ${_test_depend} - COMMENT "${LYX_PYTHON_EXECUTABLE}" "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py" - "${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${_tex2lyx}" - "${TOP_SRC_DIR}/lib/scripts" - "${CMAKE_CURRENT_BINARY_DIR}" -) +#file(GLOB _tex_tests RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.ltx" "${CMAKE_CURRENT_SOURCE_DIR}/*.tex") +# +#list(REMOVE_ITEM _tex_tests DummyDocument.tex) -#ADD_CUSTOM_TARGET(test DEPENDS ${_tex2lyx} ${_lyx} ${_test_output}) +set(_tex_tests test.ltx + algo2e.tex + box-color-size-space-align.tex + CJK.tex + CJKutf8.tex + test-insets-basic.tex + test-insets.tex + test-memoir.tex + test-modules.tex + test-refstyle-theorems.tex + test-scr.tex + test-structure.tex + XeTeX-polyglossia.tex) -add_test(NAME build_tex2lyx - COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_tex2lyx}) -add_test(NAME build_lyx - COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_lyx}) -add_test(NAME roundtrip_tex2lyx - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - COMMAND ${LYX_PYTHON_EXECUTABLE} "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py" - "${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${_tex2lyx}" - "${TOP_SRC_DIR}/lib/scripts" - "${CMAKE_CURRENT_BINARY_DIR}") +set(runtestsScript "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py") +set(scriptDir "${TOP_SRC_DIR}/lib/scripts") -set_tests_properties(build_tex2lyx PROPERTIES DEPENDS build_lyx) -set_tests_properties(roundtrip_tex2lyx PROPERTIES DEPENDS build_tex2lyx) +foreach(_fl ${_tex_tests}) + set(fl ${_fl}) + add_test(NAME tex2lyx/roundtrip/${_fl} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${CMAKE_COMMAND} + -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR} + -DLYX_USERDIR_VER=${LYX_USERDIR_VER} + -DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE} + -DPY_SCRIPT=${runtestsScript} + -DTEX2LYX_EXE=$ + -DSCRIPT_DIR=${scriptDir} + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR} + -DTESTFILE=${fl} + -P ${TOP_SRC_DIR}/src/tex2lyx/test/runtests.cmake) + set_tests_properties(tex2lyx/roundtrip/${_fl} PROPERTIES RESOURCE_LOCK "runtests.lock" LABELS "roundtrip") + add_test(NAME tex2lyx/cmplyx/${_fl} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${CMAKE_COMMAND} + -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR} + -DLYX_USERDIR_VER=${LYX_USERDIR_VER} + -DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE} + -DPY_SCRIPT=${runtestsScript} + -DFIRST_PARAM=uselyx2lyx + -DTEX2LYX_EXE=$ + -DSCRIPT_DIR=${scriptDir} + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR} + -DTESTFILE=${fl} + -P ${TOP_SRC_DIR}/src/tex2lyx/test/runtests.cmake) + set_tests_properties(tex2lyx/cmplyx/${_fl} PROPERTIES RESOURCE_LOCK "runtests.lock" LABELS "cmplyx") +endforeach() + +add_dependencies(lyx_run_tests ${_tex2lyx} ${_lyx}) + +add_custom_command( + OUTPUT LyxTestFiles + COMMAND ${CMAKE_COMMAND} -E touch LyxTestFiles + COMMAND env LYX_USERDIR_VER=${LYX_USERDIR_VER} + ${LYX_PYTHON_EXECUTABLE} "${runtestsScript}" $ "${scriptDir}" "${CMAKE_CURRENT_SOURCE_DIR}" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS ${_tex2lyx} ${_lyx} +) +add_custom_target(updatetex2lyxtests DEPENDS LyxTestFiles)