Make export tests more extendable

For both CMake and autotools. Now we can easily add
the examples to the export tests.
This commit is contained in:
Scott Kostyshak 2013-02-16 03:02:38 -05:00
parent fe24992a93
commit 010dfb6a5a
2 changed files with 34 additions and 29 deletions

View File

@ -62,23 +62,25 @@ macro(getdefaultoutputformat filepath varname)
endforeach()
endmacro()
file(GLOB lyx_files RELATIVE "${TOP_SRC_DIR}/lib/doc" "${TOP_SRC_DIR}/lib/doc/*.lyx")
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 autotests/export/${f}_lyx16
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
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("${TOP_SRC_DIR}/lib/doc/${f}.lyx" formatlist)
getdefaultoutputformat("${LIBSUB_SRC_DIR}/${f}.lyx" formatlist)
foreach(format "xhtml" ${formatlist})
add_test(NAME autotests/export/${f}_${format}
add_test(NAME export/autotests/${libsubfolder}/${f}_${format}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR}/lib/doc
COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
-Dlyx=$<TARGET_FILE:${_lyx}>
-Dformat=${format}
-Dextension=${format}
@ -86,5 +88,6 @@ foreach(f ${lyx_files})
-P "${TOP_SRC_DIR}/development/autotests/export.cmake")
endforeach()
endforeach()
endforeach()

View File

@ -1,8 +1,9 @@
#!/bin/bash
failed=0
for libsubdir in doc; do
for format in xhtml lyx16x; do
for f in $LYX_ROOT/lib/doc/*lyx; 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
@ -10,6 +11,7 @@ for format in xhtml lyx16x; do
failed=$[$failed+1];
fi;
done;
done;
done
if [ $failed -eq 0 ]; then