regression.py
changeset 4654 2eaebe77d66b
parent 4584 7f4ee7f84b19
     1.1 --- a/regression.py	Wed Jun 24 18:42:07 2009 +0100
     1.2 +++ b/regression.py	Sat Jul 04 08:15:48 2009 +0200
     1.3 @@ -40,6 +40,26 @@
     1.4      import filecmp
     1.5      comp = filecmp.dircmp(dir1, dir2)
     1.6      differ = (comp.left_only or comp.right_only or comp.diff_files)
     1.7 +
     1.8 +    if differ:
     1.9 +        # ok, stupid binary comparison reports differences, but maybe
    1.10 +        # only text files differ, in which case we should compare
    1.11 +        # again while ignoring newline differences between
    1.12 +        # windows/mac/unix.
    1.13 +        if not comp.left_only and not comp.right_only:
    1.14 +            for diff_fname in comp.diff_files:
    1.15 +                if not (diff_fname.endswith(".tr") or diff_fname.endswith(".mob")):
    1.16 +                    # doesn't look like a text file; it has to differ
    1.17 +                    break
    1.18 +                diff_file1 = open(os.path.join(dir1, diff_fname), "rtU").readlines()
    1.19 +                diff_file2 = open(os.path.join(dir2, diff_fname), "rtU").readlines()
    1.20 +                if diff_file1 != diff_file2:
    1.21 +                    break
    1.22 +                #else:
    1.23 +                #    print ">>>>>>>> %s file does not really differ!" % (diff_fname)
    1.24 +            else:
    1.25 +                differ = False
    1.26 +
    1.27      if differ:
    1.28          if verbose:
    1.29              comp.report()