Am Dienstag, 8. November 2016 um 07:21:46, schrieb Guenter Milde 
<mi...@users.sf.net>
> On 2016-11-07, Kornel Benko wrote:
> > Am Montag, 7. November 2016 um 15:47:28, schrieb Guenter Milde 
> > <mi...@users.sf.net>
>
> Dear Kornel,
>
> ...
>
> >> One export route suffices. This is why I set the "default output format"
> >> to pdf2 in the sample files.
>
> > Do you(we) want all encoding tests for 084-misc-symbols_pdf2* be
> > contained in one test, or do you prefer them be separate?
>
> Actually, 084-misc-symbols was only an example.
>
> A simple way for proper testing of the data files "lib/unicodesymbols"
> and "lib/encodings", would be to create 9*51 separate tests for
> the 9 sample files¹ matching "autotests/export/latex/Unicode-characters/*.lyx"
> in all 51 input encodings² defined in lib/encodings.
>
> ¹ After removing the 9 "doublettes" "Unicode-characters/*utf8.lyx".
>
> ² Possibly some encodings only work with special export routes, these
>   encodings could be excluded with patterns in "ignoredTests".
>
> Thanks a lot,
>
> Günter

Try this if you like. (Doubles not removed).

        Kornel

Attachment: signature.asc
Description: This is a digitally signed message part.

diff --git a/development/autotests/ExportTests.cmake b/development/autotests/ExportTests.cmake
index 1ac4879..09d2de9 100644
--- a/development/autotests/ExportTests.cmake
+++ b/development/autotests/ExportTests.cmake
@@ -381,31 +381,45 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates autote
         set(fonttypes "defaultF")
       endif()
       foreach(fonttype ${fonttypes})
-        if(fonttype MATCHES "defaultF")
-          set(TestName "export/${libsubfolder}/${f}_${format}")
+        if (format MATCHES "pdf2" AND f MATCHES "Unicode-characters")
+          #message(STATUS "Test ${TestName} matches Unicode encodings")
+          set(test_encodings "default" "utf8" "armscii" "latin1" "tis620-0" "utf8-plain" "ascii")
         else()
-          set(TestName "export/${libsubfolder}/${f}_${format}_${fonttype}")
-        endif()
-        set(mytestlabel ${testlabel})
-        maketestname(TestName inverted invertedTests ignoredTests unreliableTests mytestlabel)
-        if(TestName)
-          add_test(NAME ${TestName}
-            WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
-            COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
-            -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR}
-            -Dlyx=$<TARGET_FILE:${_lyx}>
-            -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
-            -Dformat=${format}
-            -Dfonttype=${fonttype}
-            -Dextension=${format}
-            -Dfile=${f}
-            -Dinverted=${inverted}
-            -DTOP_SRC_DIR=${TOP_SRC_DIR}
-            -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
-            -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE}
-            -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
-          setmarkedtestlabel(${TestName} ${mytestlabel}) # check for suspended pdf/dvi exports
+          set(test_encodings "default")
         endif()
+        foreach (_enc2 ${test_encodings})
+          if ("${_enc2}" STREQUAL "default")
+            set(_enc "")
+          else()
+            set(_enc "_${_enc2}")
+          endif()
+          if(fonttype MATCHES "defaultF")
+            set(TestName "export/${libsubfolder}/${f}${_enc}_${format}")
+          else()
+            set(TestName "export/${libsubfolder}/${f}${_enc}_${format}_${fonttype}")
+          endif()
+          set(mytestlabel ${testlabel})
+          maketestname(TestName inverted invertedTests ignoredTests unreliableTests mytestlabel)
+          if(TestName)
+            add_test(NAME ${TestName}
+              WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
+              COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
+              -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR}
+              -Dlyx=$<TARGET_FILE:${_lyx}>
+              -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
+              -Dformat=${format}
+              -Dfonttype=${fonttype}
+              -Dextension=${format}
+              -Dfile=${f}
+              -Dinverted=${inverted}
+              -DTOP_SRC_DIR=${TOP_SRC_DIR}
+              -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
+              -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE}
+              -DENCODING=${_enc2}
+              -P "${TOP_SRC_DIR}/development/autotests/export.cmake")
+            setmarkedtestlabel(${TestName} ${mytestlabel}) # check for suspended pdf/dvi exports
+          endif()
+        endforeach()
       endforeach()
     endforeach()
   endforeach()
diff --git a/development/autotests/export.cmake b/development/autotests/export.cmake
index fea5e25..08fd86e 100755
--- a/development/autotests/export.cmake
+++ b/development/autotests/export.cmake
@@ -23,9 +23,10 @@
 #       -DLYX_FORMAT_NUM=${_lyx_format_num} \
 #       -Dfile=xxx \
 #       -Dinverted=[01] \
-#       -DTOP_SRC_DIR=${TOP_SRC_DIR}
-#       -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
-#       -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE}
+#       -DTOP_SRC_DIR=${TOP_SRC_DIR} \
+#       -DPERL_EXECUTABLE=${PERL_EXECUTABLE} \
+#       -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE} \
+#       -DENCODING=xxx \
 #       -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
 #
 
@@ -36,13 +37,24 @@ set(GetTempDir "${TOP_SRC_DIR}/development/autotests/getTempDir.pl")
 set(_ft ${fonttype})
 execute_process(COMMAND ${PERL_EXECUTABLE} "${GetTempDir}" "${WORKDIR}" OUTPUT_VARIABLE TempDir)
 message(STATUS "using fonttype = ${_ft}")
+if(NOT ENCODING)
+  set(ENCODING "default")
+endif()
+if(ENCODING STREQUAL "default")
+  set(_enc)
+else()
+  set(_enc "_${ENCODING}")
+endif()
 if(format MATCHES "dvi|pdf")
   message(STATUS "LYX_TESTS_USERDIR = ${LYX_TESTS_USERDIR}")
   message(STATUS "Converting with perl ${Perl_Script}")
-  set(LYX_SOURCE "${TempDir}/${file}_${format}_${_ft}.lyx")
+  set(LYX_SOURCE "${TempDir}/${file}_${format}_${_ft}${_enc}.lyx")
   message(STATUS "Using source \"${LYX_ROOT}/${file}.lyx\"")
   message(STATUS "Using dest \"${LYX_SOURCE}\"")
-  execute_process(COMMAND ${PERL_EXECUTABLE} "${Perl_Script}" "${LYX_ROOT}/${file}.lyx" "${LYX_SOURCE}" ${format} ${_ft} ${LanguageFile}
+  if(NOT "${ENCODING}" STREQUAL "default")
+    # message(STATUS "ENCODING = ${ENCODING}")
+  endif()
+  execute_process(COMMAND ${PERL_EXECUTABLE} "${Perl_Script}" "${LYX_ROOT}/${file}.lyx" "${LYX_SOURCE}" ${format} ${_ft} ${ENCODING} ${LanguageFile}
     RESULT_VARIABLE _err)
   string(COMPARE EQUAL  ${_err} 0 _erg)
   if(NOT _erg)
diff --git a/development/autotests/useSystemFonts.pl b/development/autotests/useSystemFonts.pl
index c68686b..58006b0 100644
--- a/development/autotests/useSystemFonts.pl
+++ b/development/autotests/useSystemFonts.pl
@@ -65,7 +65,7 @@ sub getLangEntry();
 
 # convert lyx file to be compilable with xetex
 
-my ($source, $dest, $format, $fontT, $languageFile, $rest) = @ARGV;
+my ($source, $dest, $format, $fontT, $encodingT, $languageFile, $rest) = @ARGV;
 my %encodings = ();      # Encoding with TeX fonts, depending on language tag
 
 diestack("Too many arguments") if (defined($rest));
@@ -73,6 +73,7 @@ diestack("Sourcefilename not defined") if (! defined($source));
 diestack("Destfilename not defined") if (! defined($dest));
 diestack("Format (e.g. pdf4) not defined") if (! defined($format));
 diestack("Font type (e.g. texF) not defined") if (! defined($fontT));
+diestack("Encoding (e.g. ascii) not defined") if (! defined($encodingT));
 
 $source = File::Spec->rel2abs($source);
 $dest = File::Spec->rel2abs($dest);
@@ -123,6 +124,13 @@ if ($fontT eq "systemF") {
     $font{typewriter} = "FreeMono";
   }
 }
+elsif ($encodingT ne "default") {
+  # set input encoding to the requested value
+  $inputEncoding = {
+        "search" => '.*', # this will be substituted from '\inputencoding'-line
+	"out" => $encodingT,
+    };
+}
 elsif (0) { # set to '1' to enable setting of inputencoding
   # use tex font here
   my %encoding = ();
@@ -165,7 +173,7 @@ my $destdirOfSubdocuments;
 if(-d $destdirOfSubdocuments) {
   rmtree($destdirOfSubdocuments);
 }
-mkdir($destdirOfSubdocuments);	#  for possibly included files
+mkpath($destdirOfSubdocuments);	#  for possibly included files
 
 my %IncludedFiles = ();
 my %type2hash = (

Reply via email to