]> git.lyx.org Git - features.git/commitdiff
Cmake build: Added target updatetex2lyxtests to update lyx2lyx test files
authorKornel Benko <kornel@lyx.org>
Sun, 17 May 2015 13:51:28 +0000 (15:51 +0200)
committerKornel Benko <kornel@lyx.org>
Sun, 17 May 2015 13:51:28 +0000 (15:51 +0200)
src/tex2lyx/test/CMakeLists.txt

index c64e8eb01fe47695c08de7210e1d0dacfb5c5b0e..ded8cd26070f168ffda6613a70e5c7ce71538f04 100644 (file)
@@ -24,6 +24,9 @@ set(_tex_tests test.ltx
                XeTeX-polyglossia.tex
                algo2e.tex)
 
+set(runtestsScript "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py")
+set(scriptDir "${TOP_SRC_DIR}/lib/scripts")
+
 foreach(_fl ${_tex_tests})
   set(fl ${_fl})
   add_test(NAME tex2lyx/roundtrip/${_fl}
@@ -32,9 +35,9 @@ foreach(_fl ${_tex_tests})
       -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR}
       -DLYX_USERDIR_VER=${LYX_USERDIR_VER}
       -DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE}
-      -DPY_SCRIPT=${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py
+      -DPY_SCRIPT=${runtestsScript}
       -DTEX2LYX_EXE=$<TARGET_FILE:${_tex2lyx}>
-      -DSCRIPT_DIR=${TOP_SRC_DIR}/lib/scripts
+      -DSCRIPT_DIR=${scriptDir}
       -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}
       -DTESTFILE=${fl}
       -P ${TOP_SRC_DIR}/src/tex2lyx/test/runtests.cmake)
@@ -45,10 +48,10 @@ foreach(_fl ${_tex_tests})
       -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR}
       -DLYX_USERDIR_VER=${LYX_USERDIR_VER}
       -DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE}
-      -DPY_SCRIPT=${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py
+      -DPY_SCRIPT=${runtestsScript}
       -DFIRST_PARAM=uselyx2lyx
       -DTEX2LYX_EXE=$<TARGET_FILE:${_tex2lyx}>
-      -DSCRIPT_DIR=${TOP_SRC_DIR}/lib/scripts
+      -DSCRIPT_DIR=${scriptDir}
       -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}
       -DTESTFILE=${fl}
       -P ${TOP_SRC_DIR}/src/tex2lyx/test/runtests.cmake)
@@ -57,3 +60,13 @@ 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}" $<TARGET_FILE:${_tex2lyx}> "${scriptDir}" "${CMAKE_CURRENT_SOURCE_DIR}"
+  WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+  DEPENDS ${_tex2lyx} ${_lyx}
+)
+
+add_custom_target(updatetex2lyxtests DEPENDS LyxTestFiles)