8888 SVG = ('tex_demo.py,' ),
8989 )
9090
91- def drive (backend , python = 'python' ):
91+ def drive (backend , python = 'python' , switches = [] ):
9292
9393 exclude = failbackend .get (backend , [])
94+ switchstring = ' ' .join (switches )
9495
9596 for fname in files :
9697 if fname in exclude :
9798 print '\t Skipping %s, known to fail on backend: %s' % backend
9899 continue
99100
100- print '\t driving %s' % fname
101+ print '\t driving %s %s ' % ( fname , switchstring )
101102 basename , ext = os .path .splitext (fname )
102103 outfile = basename + '_%s' % backend
103104 tmpfile_name = '_tmp_%s.py' % basename
@@ -123,7 +124,7 @@ def drive(backend, python='python'):
123124 tmpfile .write ('savefig("%s", dpi=150)' % outfile )
124125
125126 tmpfile .close ()
126- os .system ('%s %s' % (python , tmpfile_name ))
127+ os .system ('%s %s %s ' % (python , tmpfile_name , switchstring ))
127128 os .remove (tmpfile_name )
128129
129130
@@ -139,14 +140,16 @@ def drive(backend, python='python'):
139140 python = r'c:\Python24\python.exe'
140141 else :
141142 python = 'python'
143+ switches = []
142144 if sys .argv [1 :]:
143145 backends = [b for b in sys .argv [1 :] if b in default_backends ]
144- else :
146+ switches = [s for s in sys .argv [1 :] if s .startswith ('--' )]
147+ if not backends :
145148 backends = default_backends
146149 for backend in backends :
147150 print 'testing %s' % backend
148151 t0 = time .time ()
149- drive (backend , python )
152+ drive (backend , python , switches )
150153 t1 = time .time ()
151154 times [backend ] = (t1 - t0 )/ 60.0
152155
0 commit comments