]> git.lyx.org Git - lyx.git/blobdiff - development/autotests/ExportTests.cmake
DocBook: do a little something for Sweave & co.
[lyx.git] / development / autotests / ExportTests.cmake
index febac166422fb1a2f0c7f504f423641e74a7878c..e8ab4f5af865466c1230804a6818372ae53d9c57 100644 (file)
 
 find_package(Perl)
 find_program(XMLLINT_EXECUTABLE xmllint)
+find_program(JAVA_EXECUTABLE java)
+set(jingjava)
+if (JAVA_EXECUTABLE)
+  if (EXISTS "${TOP_SRC_DIR}/development/tools/jing.jar")
+    set(jingjava ${JAVA_EXECUTABLE})
+  endif()
+endif()
 
 if(PERL_FOUND)
   set(DVI_FORMATS "dvi" "dvi3")
@@ -52,20 +59,22 @@ macro(getoutputformats filepath varname format_set)
   file(STRINGS "${filepath}" lines)
   # What should we test, if default_output_format is not defined?
   # For now we test everything ...
-  set(out_formats "xhtml" ${DVI_FORMATS} ${PDF_FORMATS})
+  set(out_formats "xhtml" "docbook5" ${DVI_FORMATS} ${PDF_FORMATS})
   foreach(_l IN LISTS lines)
     if(_l MATCHES "^\\\\default_output_format +\([^ ]+\)")
       set(_format ${CMAKE_MATCH_1})
       if(_format STREQUAL "default")
-        set(out_formats "xhtml" ${DVI_FORMATS} ${PDF_FORMATS})
+        set(out_formats "xhtml" "docbook5" ${DVI_FORMATS} ${PDF_FORMATS})
       else()
         set(${format_set} ${_format})
         if(_format STREQUAL "pdf2" AND "${filepath}" MATCHES "/doc/")
-          set(out_formats "xhtml" ${DVI_FORMATS} ${PDF_FORMATS})
+          set(out_formats "xhtml" "docbook5" ${DVI_FORMATS} ${PDF_FORMATS})
         elseif(_format MATCHES "pdf$")
-          set(out_formats "xhtml" ${PDF_FORMATS})
+          set(out_formats "xhtml" "docbook5" ${PDF_FORMATS})
         elseif(_format MATCHES "dvi$")
-          set(out_formats "xhtml" ${DVI_FORMATS})
+          set(out_formats "xhtml" "docbook5" ${DVI_FORMATS})
+        elseif(_format MATCHES "docbook5")
+          set(out_formats "docbook5")
         elseif(_format MATCHES "xhtml")
           set(out_formats "xhtml")
         else()
@@ -160,11 +169,7 @@ macro(maketestname testname inverted listinverted listignored listunreliable lis
     string(REGEX MATCH "(^check_load|_(systemF|texF|pdf3|pdf2|pdf|dvi|lyx[0-9][0-9]|xhtml)$)" _v ${${testname}})
     # check if test _may_ be in listinverted
     set(sublabel2 "")
-    if (_v)
-      findexpr(mfound ${testname} ${listinvertedx} sublabel2)
-    else()
-      set(mfound OFF)
-    endif()
+    findexpr(mfound ${testname} ${listinvertedx} sublabel2)
     if (mfound)
       set(sublabel3 "")
       findexpr(foundsuspended ${testname} ${listsuspendedx} sublabel3)
@@ -444,7 +449,7 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates lib/ta
             set(extraLabels )
           endif()
           set(missingLabels )
-          findexpr(mfound TestName ignoreLatexErrorsTests missingLabels)
+          findexpr(mfound TestName1 ignoreLatexErrorsTests missingLabels)
           if (mfound)
             set(mytestlabel ${testlabel} "ignoring" ${missingLabels} ${extraLabels})
           else()
@@ -452,6 +457,11 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates lib/ta
           endif()
           string(REGEX REPLACE "[\\(\\)]" "_" TestName "${TestName1}")
           maketestname(TestName inverted invertedTests ignoredTests unreliableTests mytestlabel)
+         if (format MATCHES "docbook5")
+           set(f_extension "xml")
+         else()
+           set(f_extension ${format})
+         endif()
           if(TestName)
             add_test(NAME ${TestName}
               WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
@@ -461,13 +471,14 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates lib/ta
               -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
               -Dformat=${format}
               -Dfonttype=${fonttype}
-              -Dextension=${format}
+              -Dextension=${f_extension}
               -Dfile=${f}
               -Dinverted=${inverted}
               -DTOP_SRC_DIR=${TOP_SRC_DIR}
               "-DIgnoreErrorMessage=${missingLabels}"
               -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
               -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE}
+              -DJAVA_EXECUTABLE=${jingjava}
               -DENCODING=${_enc2}
               -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
             setmarkedtestlabel(${TestName} ${mytestlabel}) # check for suspended pdf/dvi exports