]> git.lyx.org Git - features.git/commitdiff
Make export tests more extendable
authorScott Kostyshak <skostysh@lyx.org>
Sat, 16 Feb 2013 08:02:38 +0000 (03:02 -0500)
committerScott Kostyshak <skostysh@lyx.org>
Sat, 16 Feb 2013 11:27:09 +0000 (06:27 -0500)
For both CMake and autotools. Now we can easily add
the examples to the export tests.

development/autotests/CMakeLists.txt
development/autotests/export-in.sh

index f867033d9c452f4fe85375bc750d32d6315e087b..a0e06d7db2cddde7257602dfa39de73fba7f7b77 100644 (file)
@@ -62,28 +62,31 @@ macro(getdefaultoutputformat filepath varname)
   endforeach()
 endmacro()
 
-file(GLOB lyx_files RELATIVE "${TOP_SRC_DIR}/lib/doc" "${TOP_SRC_DIR}/lib/doc/*.lyx")
-foreach(f ${lyx_files})
-  # Strip extension
-  string(REGEX REPLACE "\\.lyx$" "" f ${f})
-  add_test(NAME autotests/export/${f}_lyx16
-    WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
-    COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR}/lib/doc
-            -Dlyx=$<TARGET_FILE:${_lyx}>
-           -Dformat=lyx16x
-           -Dextension=16.lyx
-           -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}
+foreach(libsubfolder doc)
+  set(LIBSUB_SRC_DIR "${TOP_SRC_DIR}/lib/${libsubfolder}")
+  file(GLOB lyx_files RELATIVE "${LIBSUB_SRC_DIR}" "${LIBSUB_SRC_DIR}/*.lyx")
+  foreach(f ${lyx_files})
+    # Strip extension
+    string(REGEX REPLACE "\\.lyx$" "" f ${f})
+    add_test(NAME export/autotests/${libsubfolder}/${f}_lyx16
       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")
+      COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
+          -Dlyx=$<TARGET_FILE:${_lyx}>
+          -Dformat=lyx16x
+          -Dextension=16.lyx
+          -Dfile=${f}
+          -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
+    getdefaultoutputformat("${LIBSUB_SRC_DIR}/${f}.lyx" formatlist)
+    foreach(format "xhtml" ${formatlist})
+      add_test(NAME export/autotests/${libsubfolder}/${f}_${format}
+        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
+        COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
+            -Dlyx=$<TARGET_FILE:${_lyx}>
+            -Dformat=${format}
+            -Dextension=${format}
+            -Dfile=${f}
+            -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
+    endforeach()
   endforeach()
 endforeach()
 
index 275ee085ae34893446645ac0bb93c776044d7b67..4757695e9bec48a7913c581f04dcd1cb173993e7 100755 (executable)
@@ -1,14 +1,16 @@
 #!/bin/bash
 
 failed=0
-for format in xhtml lyx16x; do
-    for f in $LYX_ROOT/lib/doc/*lyx; do
-        if $LYX_EXE -e $format $f >> lyx-log.txt 2>&1; then
-            echo $format $f TEST_GOOD
-        else
-            echo $format $f TEST_BAD
-           failed=$[$failed+1];
-        fi;
+for libsubdir in doc; do
+    for format in xhtml lyx16x; do
+        for f in $LYX_ROOT/lib/$libsubdir/*lyx; do
+            if $LYX_EXE -e $format $f >> lyx-log.txt 2>&1; then
+                echo $format $f TEST_GOOD
+            else
+                echo $format $f TEST_BAD
+                failed=$[$failed+1];
+            fi;
+        done;
     done;
 done