From: <as...@us...> - 2009-09-06 03:39:58
|
Revision: 7653 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7653&view=rev Author: astraw Date: 2009-09-06 03:39:42 +0000 (Sun, 06 Sep 2009) Log Message: ----------- testing: collect new image results on failed image comparisons Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/testing/compare.py trunk/matplotlib/test/_buildbot_test_postmortem.py Modified: trunk/matplotlib/lib/matplotlib/testing/compare.py =================================================================== --- trunk/matplotlib/lib/matplotlib/testing/compare.py 2009-09-06 01:44:09 UTC (rev 7652) +++ trunk/matplotlib/lib/matplotlib/testing/compare.py 2009-09-06 03:39:42 UTC (rev 7653) @@ -7,6 +7,7 @@ import operator import os import numpy as np +import shutil #======================================================================= @@ -121,6 +122,7 @@ save_diff_image( expected, actual, diff_image ) if in_decorator: + shutil.copyfile( expected, 'expected-'+os.path.basename(actual)) results = dict( rms = rms, expected = str(expected), Modified: trunk/matplotlib/test/_buildbot_test_postmortem.py =================================================================== --- trunk/matplotlib/test/_buildbot_test_postmortem.py 2009-09-06 01:44:09 UTC (rev 7652) +++ trunk/matplotlib/test/_buildbot_test_postmortem.py 2009-09-06 03:39:42 UTC (rev 7653) @@ -9,9 +9,10 @@ roots = ['test_matplotlib','test_plots'] savedresults_dir = 'saved-results' baseline_dir = 'baseline' -basename = 'failed-diff-' +expected_basename = 'expected-' +diff_basename = 'failed-diff-' target_dir = os.path.abspath('status_images') -nbase = len(basename) +nbase = len(diff_basename) def listFiles(root, patterns='*', recurse=1, return_folders=0): """ @@ -76,7 +77,31 @@ if os.path.exists(target_dir): shutil.rmtree(target_dir) os.makedirs( target_dir ) # prevent buildbot DirectoryUpload failure + + # new matplotlib.testing infrastructure + os.chdir('test') + for fname in glob.glob('*.png'): + absdiff_fname = diff_basename + fname + expected_fname = expected_basename + fname + if not os.path.exists(absdiff_fname): + continue + if not os.path.exists(expected_fname): + continue + print fname + print absdiff_fname + + teststr = os.path.splitext(fname)[0] + this_targetdir = os.path.join(target_dir,teststr) + os.makedirs( this_targetdir ) + shutil.copy( expected_fname, + os.path.join(this_targetdir,'baseline.png') ) + shutil.copy( fname, + os.path.join(this_targetdir,'actual.png') ) + shutil.copy( absdiff_fname, + os.path.join(this_targetdir,'absdiff.png') ) + + # old mplTest infrastructure for fpath in get_recursive_filelist(roots): # only images if not fpath.endswith('.png'): continue @@ -87,7 +112,7 @@ root = pieces[0] testclass = pieces[2] fname = pieces[3] - if not fname.startswith(basename): + if not fname.startswith(diff_basename): # only failed images continue origname = fname[nbase:] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |