99roots = ['test_matplotlib' ,'test_plots' ]
1010savedresults_dir = 'saved-results'
1111baseline_dir = 'baseline'
12- basename = 'failed-diff-'
12+ expected_basename = 'expected-'
13+ diff_basename = 'failed-diff-'
1314target_dir = os .path .abspath ('status_images' )
14- nbase = len (basename )
15+ nbase = len (diff_basename )
1516
1617def listFiles (root , patterns = '*' , recurse = 1 , return_folders = 0 ):
1718 """
@@ -76,7 +77,31 @@ def path_split_all(fname):
7677 if os .path .exists (target_dir ):
7778 shutil .rmtree (target_dir )
7879 os .makedirs ( target_dir ) # prevent buildbot DirectoryUpload failure
80+
81+ # new matplotlib.testing infrastructure
82+
7983 os .chdir ('test' )
84+ for fname in glob .glob ('*.png' ):
85+ absdiff_fname = diff_basename + fname
86+ expected_fname = expected_basename + fname
87+ if not os .path .exists (absdiff_fname ):
88+ continue
89+ if not os .path .exists (expected_fname ):
90+ continue
91+ print fname
92+ print absdiff_fname
93+
94+ teststr = os .path .splitext (fname )[0 ]
95+ this_targetdir = os .path .join (target_dir ,teststr )
96+ os .makedirs ( this_targetdir )
97+ shutil .copy ( expected_fname ,
98+ os .path .join (this_targetdir ,'baseline.png' ) )
99+ shutil .copy ( fname ,
100+ os .path .join (this_targetdir ,'actual.png' ) )
101+ shutil .copy ( absdiff_fname ,
102+ os .path .join (this_targetdir ,'absdiff.png' ) )
103+
104+ # old mplTest infrastructure
80105 for fpath in get_recursive_filelist (roots ):
81106 # only images
82107 if not fpath .endswith ('.png' ): continue
@@ -87,7 +112,7 @@ def path_split_all(fname):
87112 root = pieces [0 ]
88113 testclass = pieces [2 ]
89114 fname = pieces [3 ]
90- if not fname .startswith (basename ):
115+ if not fname .startswith (diff_basename ):
91116 # only failed images
92117 continue
93118 origname = fname [nbase :]
0 commit comments