The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 55d32635e186d3c2b6dc793d4ebc96ec9de07885
Author: Kornel Benko <kor...@lyx.org>
Date:   Thu Jan 24 17:58:44 2013 +0100

    Cmake build: Add pdf, pdf2 and pdf5 formats to export testcases

diff --git a/development/autotests/CMakeLists.txt 
b/development/autotests/CMakeLists.txt
index d611307..f867033 100644
--- a/development/autotests/CMakeLists.txt
+++ b/development/autotests/CMakeLists.txt
@@ -47,6 +47,21 @@ if(Q_WS_X11)
   endif()
 endif()
 
+macro(getdefaultoutputformat filepath varname)
+  file(STRINGS "${filepath}" lines)
+  set(${varname} "pdf") # try at least this one
+  foreach(_l ${lines})
+    if(_l MATCHES "^\\\\default_output_format +\([^ ]+\)")
+      set(found ${CMAKE_MATCH_1})
+      if(found STREQUAL "default")
+       set(found "pdf" "pdf2" "pdf5")
+      endif()
+      set(${varname} ${found})
+      break()
+    endif()
+  endforeach()
+endmacro()
+
 file(GLOB lyx_files RELATIVE "${TOP_SRC_DIR}/lib/doc" 
"${TOP_SRC_DIR}/lib/doc/*.lyx")
 foreach(f ${lyx_files})
   # Strip extension
@@ -59,14 +74,17 @@ foreach(f ${lyx_files})
            -Dextension=16.lyx
            -Dfile=${f}
            -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
-  add_test(NAME autotests/export/${f}_xhtml
-    WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
-    COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR}/lib/doc
-            -Dlyx=$<TARGET_FILE:${_lyx}>
-           -Dformat=xhtml
-           -Dextension=xhtml
-           -Dfile=${f}
-           -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
+  getdefaultoutputformat("${TOP_SRC_DIR}/lib/doc/${f}.lyx" formatlist)
+  foreach(format "xhtml" ${formatlist})
+    add_test(NAME autotests/export/${f}_${format}
+      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
+      COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR}/lib/doc
+             -Dlyx=$<TARGET_FILE:${_lyx}>
+             -Dformat=${format}
+             -Dextension=${format}
+             -Dfile=${f}
+             -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
+  endforeach()
 endforeach()
 
 

-----------------------------------------------------------------------

Summary of changes:
 development/autotests/CMakeLists.txt |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to