]> git.lyx.org Git - lyx.git/blobdiff - development/autotests/export.cmake
ctests: ignore Japanese dvi3 systemF tests
[lyx.git] / development / autotests / export.cmake
index 33a45253820cad0fe499b65b11f10b370aeeb9a3..4c77f06bb4ef4796b6c7d66eebe0a802bec1c0dd 100755 (executable)
@@ -48,6 +48,15 @@ if(ENCODING STREQUAL "default")
 else()
   set(_enc "_${ENCODING}")
 endif()
+
+# move the the last directory part of LYX_ROOT to filename
+# to make the destination unique for otherwise identical
+# filenames
+get_filename_component(updir_ "${LYX_ROOT}" DIRECTORY)
+get_filename_component(updir2_ "${LYX_ROOT}" NAME)
+set(file "${updir2_}/${file}")
+set(LYX_ROOT "${updir_}")
+
 if(format MATCHES "dvi|pdf")
   message(STATUS "LYX_TESTS_USERDIR = ${LYX_TESTS_USERDIR}")
   message(STATUS "Converting with perl ${Perl_Script}")
@@ -197,7 +206,7 @@ else()
   if ($ENV{LYX_DEBUG_LATEX})
     set(LyXExtraParams -dbg latex)
   else()
-    set(LyXExtraParams)
+    set(LyXExtraParams -dbg info)
   endif()
   if(IgnoreErrorMessage)
     foreach (_em ${IgnoreErrorMessage})
@@ -220,29 +229,47 @@ else()
     else()
       message(STATUS "Expected result file \"${result_file_name}\" exists")
       if (extension MATCHES "^x(ht)?ml$")
-       if (format MATCHES "xhtml")
-         set(xmllint_params --sax --html --valid)
-       else()
-         set(xmllint_params --sax --valid)
-       endif()
+        if (format MATCHES "xhtml")
+          set(xmllint_params --loaddtd --noout)
+          set(executable_ ${XMLLINT_EXECUTABLE})
+        else()
+          set(xmllint_params)
+          set(executable_ ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/development/autotests/filterXml4Sax.pl")
+          # Check with perl xml-parser
+          # needs XML::Parser module
+          message(STATUS "Calling ${PERL_EXECUTABLE} \"${TOP_SRC_DIR}/development/autotests/xmlParser.pl\" \"${result_file_name}\"")
+          execute_process(
+            COMMAND ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/development/autotests/xmlParser.pl" "${result_file_name}"
+            OUTPUT_VARIABLE parserout
+            ERROR_VARIABLE parsererr
+            RESULT_VARIABLE _err
+          )
+          if (_err)
+            message(STATUS "${parsererr}")
+          endif()
+          Summary(_err "Checking \"${result_file_name}\" with xmlParser.pl")
+        endif()
         if (XMLLINT_EXECUTABLE)
-          message(STATUS "Calling: ${XMLLINT_EXECUTABLE} " ${xmllint_params})
+          string(REPLACE ";" " " xmllint_params2 " ${xmllint_params}")
+          message(STATUS "Calling: " ${executable_} ${xmllint_params2} " ${WORKDIR}/${result_file_name}")
           # check the created xhtml file
           execute_process(
-            COMMAND ${XMLLINT_EXECUTABLE} ${xmllint_params}  "${result_file_name}"
+            COMMAND ${executable_} ${xmllint_params}  "${result_file_name}"
             OUTPUT_VARIABLE xmlout
             ERROR_VARIABLE xmlerr
             RESULT_VARIABLE _err)
           file(WRITE "${result_file_name}.sax_out" ${xmlout})
           Summary(_err "Checking \"${result_file_name}\" with ${XMLLINT_EXECUTABLE}")
           if (NOT _err)
-            # check if sax-parser output contains error messages
+            # check if parser output contains error messages
             message(STATUS "Check the output: ${PERL_EXECUTABLE} ${TOP_SRC_DIR}/development/autotests/examineXmllintOutput.pl")
             execute_process(
               COMMAND ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/development/autotests/examineXmllintOutput.pl" "${result_file_name}.sax_out"
               OUTPUT_VARIABLE xmlout
               RESULT_VARIABLE _err)
             Summary(_err "Parse messages of ${XMLLINT_EXECUTABLE} for errors")
+          else()
+            message(STATUS "Errors from xmllint: ${xmlerr}")
           endif()
           if (NOT _err)
             if (NOT "${xmlout}" STREQUAL "")