Cmake lyx2lyx tests: Correct use of value for \use_non_tex_fonts

Amend eec3d1eb,7568571a
We are trying to check if the resulting file after lyx2lyx
is compilable, we have to ensure that copying the original file
to the test directory does not mangle use_non_tex_fonts-entry.
This commit is contained in:
Kornel Benko 2019-01-05 08:34:00 +01:00
parent 7f5e7c89b4
commit c9e62dec53
2 changed files with 10 additions and 5 deletions

View File

@ -69,7 +69,7 @@ else()
set(LYX_SOURCE "${TempDir}/${file}.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} "default" "default" ${LanguageFile}
execute_process(COMMAND ${PERL_EXECUTABLE} "${Perl_Script}" "${LYX_ROOT}/${file}.lyx" "${LYX_SOURCE}" ${format} "dontChange" "default" ${LanguageFile}
RESULT_VARIABLE _err)
string(COMPARE EQUAL ${_err} 0 _erg)
if(NOT _erg)

View File

@ -56,6 +56,9 @@ sub initLyxStack($$$)
if ($_[1] eq "systemF") {
$useNonTexFont = "true";
}
elsif ($_[1] eq "dontChange") {
$useNonTexFont = "dontChange";
}
else {
$useNonTexFont = "false";
$inputEncoding = $_[2];
@ -220,10 +223,12 @@ sub checkForHeader($)
push(@rElems, $elem, $elem1, $elem2);
}
}
my $elemntf = newMatch("search" => qr/^\\use_non_tex_fonts\s+(false|true)/,
"filetype" => "replace_only",
"result" => ["\\use_non_tex_fonts $useNonTexFont"]);
push(@rElems, $elemntf);
if ($useNonTexFont ne "dontChange") {
my $elemntf = newMatch("search" => qr/^\\use_non_tex_fonts\s+(false|true)/,
"filetype" => "replace_only",
"result" => ["\\use_non_tex_fonts $useNonTexFont"]);
push(@rElems, $elemntf);
}
if (defined($inputEncoding)) {
my $inputenc = newMatch("search" => qr/^\\inputencoding\s+($inputEncoding->{search})/,
"filetype" => "replace_only",