Hi Georg,
how about automatic conversion of of lyx files before checking for difference?

Something like the attached works for me. And does not depend on format of 
provided lyx-files.

        Kornel
diff --git a/src/tex2lyx/test/runtests.py b/src/tex2lyx/test/runtests.py
index 13d62f6..24650f3 100755
--- a/src/tex2lyx/test/runtests.py
+++ b/src/tex2lyx/test/runtests.py
@@ -38,6 +38,7 @@ def main(argv):
     else:
         error(usage(argv[0]))
 
+    lyx = os.path.join(os.path.dirname(tex2lyx), "lyx")
     inputdir = os.path.dirname(argv[0])
     if len(argv) >= 4:
         outputdir = sys.argv[3]
@@ -62,8 +63,18 @@ def main(argv):
         if os.system(cmd) != 0:
             errors.append(f)
         elif not overwrite:
-            lyxfile1 = os.path.join(inputdir, base + ".lyx.lyx")
-            lyxfile2 = os.path.join(outputdir, base + ".lyx")
+            lyxfilex1 = os.path.join(inputdir, base + ".lyx.lyx")
+	    lyxfile1 = os.path.join(outputdir, base + ".lyx1.lyx")
+	    cmd = '%s -E lyx %s %s' % (lyx, lyxfile1, lyxfilex1)
+	    sys.stdout.writelines(cmd)
+	    if os.system(cmd) != 0:
+		errors.append(f)
+            lyxfilex2 = os.path.join(outputdir, base + ".lyx")
+            lyxfile2 = os.path.join(outputdir, base + ".lyx2.lyx")
+	    cmd = '%s -E lyx %s %s' % (lyx, lyxfile2, lyxfilex2)
+	    sys.stdout.writelines(cmd)
+	    if os.system(cmd) != 0:
+		errors.append(f)
             if not filecmp.cmp(lyxfile1, lyxfile2, False):
                 t1 = time.ctime(os.path.getmtime(lyxfile1))
                 t2 = time.ctime(os.path.getmtime(lyxfile2))

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

Reply via email to