]> git.lyx.org Git - lyx.git/commitdiff
Cmake docbook tests: Check the exported with one more tool
authorKornel Benko <kornel@lyx.org>
Wed, 5 Aug 2020 10:54:36 +0000 (12:54 +0200)
committerKornel Benko <kornel@lyx.org>
Wed, 5 Aug 2020 10:54:36 +0000 (12:54 +0200)
development/autotests/export.cmake
development/autotests/xmlParser.pl [new file with mode: 0644]

index 602099066eec0ace21f7212b53fe287db32bd8f0..55ca7a7102ab69a05663d1e9e7f8f68a32b52c7a 100755 (executable)
@@ -206,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})
@@ -235,6 +235,19 @@ else()
        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: " ${executable_} ${xmllint_params} " ${result_file_name}")
diff --git a/development/autotests/xmlParser.pl b/development/autotests/xmlParser.pl
new file mode 100644 (file)
index 0000000..e33cde8
--- /dev/null
@@ -0,0 +1,11 @@
+#! /usr/bin/env perl
+
+use strict;
+use XML::Parser;
+
+my $p1 = XML::Parser->new(Style => 'Debug', ErrorContext => 2);
+for my $arg (@ARGV) {
+  $p1->parsefile($arg);
+}
+
+exit(0);