Scott Kostyshak wrote:

> The test fails after doing lyx2lyx:
> 
> cd lib/examples/fr
> lyx -e lyx21x Foils.lyx
> mv Foils.21.lyx Foils.lyx
> 
> After doing a (manual) bisect, I narrowed the failure down to the 500 vs.
> 501 format change:
> 
> cd lib/examples/fr && git checkout Foils.lyx &&
> /home/scott/lyxbuilds/master/repo/lib/lyx2lyx/lyx2lyx -t 501 Foils.lyx >
> Foils.501.lyx && /home/scott/lyxbuilds/master/repo/lib/lyx2lyx/lyx2lyx -t
> 500 Foils.lyx > Foils.500.lyx
> 
> When I copy Foils.501.lyx to Foils.lyx and then run the tests, the tests
> pass. When I copy Foils.500.lyx to Foils.lyx and then run the tests, the
> tests fail.
> 
> I don't know if the difference comes from our testing framework or lyx2lyx
> or LyX.

OK, now I understand (thanks also to Kornel for the explanation).

This is what happens: When converting from 500 to 501, the font settings of 
the not used flavour are filled in from the fontdefaults list in lyx_2_2.py. 
Thus, after a 503->500->503 roundtrip, you get the attached patch, which 
makes the tests fail.

This is not a bug. The conversion 501->500 must be lossy, since the format 
500 is not able to store the font information of the "not used" flavour. 
Therefore, the only exports which are guaranteed to work after a conversion 
to format 500 are the ones of the used flavour (\use_non_tex_fonts false or 
true). The other flavour may fail.

IMHO it does not make sense to blindly test more and more combinations of 
conversions of the existing documents. I would rather put the energy in 
creating dedicated tests, e.g. for each lyx2lyx step. I must admit that I do 
not understand the current test strategy anymore, since there are several 
categories, and the test code became so complicated (e.g. running lyx2lyx in 
a loop or automagically changing document settings).


Georg
diff --git a/lib/examples/fr/Foils.lyx b/lib/examples/fr/Foils.lyx
index f211fdd..b14c35a 100644
--- a/lib/examples/fr/Foils.lyx
+++ b/lib/examples/fr/Foils.lyx
@@ -18,7 +18,7 @@
 \font_roman "default" "default"
 \font_sans "default" "default"
 \font_typewriter "default" "default"
-\font_math "auto" "default"
+\font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false

Reply via email to