|
From: <jd...@us...> - 2009-08-23 01:31:48
|
Revision: 7526
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7526&view=rev
Author: jdh2358
Date: 2009-08-23 01:31:40 +0000 (Sun, 23 Aug 2009)
Log Message:
-----------
updated 7 of 9 images; leaving 2 for pos control on buildbot
Modified Paths:
--------------
trunk/matplotlib/test/README.txt
trunk/matplotlib/test/consolidate_diff_images.sh
trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/formatter_ticker_004.png
trunk/matplotlib/test/test_plots/baseline/TestAnnotation/offset_points.png
trunk/matplotlib/test/test_plots/baseline/TestAnnotation/polar_axes.png
trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png
trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_units.png
Modified: trunk/matplotlib/test/README.txt
===================================================================
--- trunk/matplotlib/test/README.txt 2009-08-23 01:03:07 UTC (rev 7525)
+++ trunk/matplotlib/test/README.txt 2009-08-23 01:31:40 UTC (rev 7526)
@@ -288,3 +288,12 @@
reference and therefore needs to be called out as different that a simple
measurement of time since a delta-t in one frame may not be the same in another.
+
+
+Updating after diff
+====================
+
+ python run-mpl-test.py --all --keep-failed
+ ./consolidate_diff_images.sh
+ # check your images, decide which are good
+ python movegood.py
Modified: trunk/matplotlib/test/consolidate_diff_images.sh
===================================================================
--- trunk/matplotlib/test/consolidate_diff_images.sh 2009-08-23 01:03:07 UTC (rev 7525)
+++ trunk/matplotlib/test/consolidate_diff_images.sh 2009-08-23 01:31:40 UTC (rev 7526)
@@ -4,4 +4,4 @@
TARGET_DIR="diff-images"
rm -rf $TARGET_DIR
mkdir $TARGET_DIR
-find . -name 'failed-diff-*png' | xargs mv --target-directory=$TARGET_DIR
+find . -name 'failed-diff-*png' -exec mv {} $TARGET_DIR/ \;
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/formatter_ticker_004.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestAnnotation/offset_points.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestAnnotation/polar_axes.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_units.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-23 01:32:14
|
Revision: 7527
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7527&view=rev
Author: jdh2358
Date: 2009-08-23 01:32:06 +0000 (Sun, 23 Aug 2009)
Log Message:
-----------
add script for moving good saved images to baseline
Added Paths:
-----------
trunk/matplotlib/test/README.build_slaves
trunk/matplotlib/test/movegood.py
Added: trunk/matplotlib/test/README.build_slaves
===================================================================
--- trunk/matplotlib/test/README.build_slaves (rev 0)
+++ trunk/matplotlib/test/README.build_slaves 2009-08-23 01:32:06 UTC (rev 7527)
@@ -0,0 +1,4 @@
+There can be two different types of build slaves: virtualenv and
+python source install with clean installs of numpy and mpl. Both of
+these will need nose installed.
+
Added: trunk/matplotlib/test/movegood.py
===================================================================
--- trunk/matplotlib/test/movegood.py (rev 0)
+++ trunk/matplotlib/test/movegood.py 2009-08-23 01:32:06 UTC (rev 7527)
@@ -0,0 +1,53 @@
+import os, sys, glob, shutil
+import matplotlib.cbook as cbook
+
+savedresults_dir = 'saved-results'
+baseline_dir = 'baseline'
+diff_dir = 'diff-images'
+basename = 'failed-diff-'
+nbase = len(basename)
+
+failed = set()
+for fname in glob.glob(os.path.join(diff_dir, '%s*.png'%basename)):
+ ind = fname.find(basename)
+ fname = fname[ind+nbase:]
+ failed.add(fname)
+
+datad = dict()
+for fpath in cbook.get_recursive_filelist('.'):
+ if not fpath.endswith('.png'): continue
+ if fpath.find(diff_dir)>0: continue
+ rel_dir, fname = os.path.split(fpath)
+
+
+ saved = fpath.find(savedresults_dir)>0
+ baseline = fpath.find(baseline_dir)>0
+
+ if saved:
+ datad.setdefault(fname, [None,None])[0] = fpath
+ elif baseline:
+ datad.setdefault(fname, [None,None])[1] = fpath
+
+nfailed = len(failed)
+for ithis, fname in enumerate(sorted(failed)):
+ data = datad.get(fname)
+ if data is not None:
+ saved, baseline = data
+ #print ithis, fname, saved, baseline
+ if saved is None:
+ print 'could not find saved data for', fname
+ elif baseline is None:
+ print 'could not find baseline data for', fname
+ else:
+ x = raw_input('Copy %d of %d\n saved="%s" to\n baseline="%s" (n|Y):'%(ithis, nfailed, saved, baseline))
+ if x.lower()=='y' or x=='':
+ shutil.copy(saved, baseline)
+ print ' copied'
+ elif x.lower()=='n':
+ print ' skipping'
+ else:
+ print ' skipping unrecognized response="%s"'%x
+ print
+
+ else:
+ print 'could not find data for', fname
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-23 05:18:51
|
Revision: 7535
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7535&view=rev
Author: astraw
Date: 2009-08-23 05:18:45 +0000 (Sun, 23 Aug 2009)
Log Message:
-----------
add buildbot scripts
Added Paths:
-----------
trunk/matplotlib/test/_buildbot_install.py
trunk/matplotlib/test/_buildbot_test.py
trunk/matplotlib/test/_buildbot_util.py
Added: trunk/matplotlib/test/_buildbot_install.py
===================================================================
--- trunk/matplotlib/test/_buildbot_install.py (rev 0)
+++ trunk/matplotlib/test/_buildbot_install.py 2009-08-23 05:18:45 UTC (rev 7535)
@@ -0,0 +1,15 @@
+"""This script will install matplotlib to a virtual environment to
+faciltate testing."""
+import shutil, os, sys
+from subprocess import Popen, PIPE, STDOUT
+
+from _buildbot_util import check_call
+
+TARGET='PYmpl'
+
+if os.path.exists(TARGET):
+ shutil.rmtree(TARGET)
+
+check_call('virtualenv %s'%(TARGET,))
+TARGET_py = os.path.join(TARGET,'bin','python')
+check_call('%s setup.py install'%TARGET_py)
Added: trunk/matplotlib/test/_buildbot_test.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test.py (rev 0)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-08-23 05:18:45 UTC (rev 7535)
@@ -0,0 +1,15 @@
+"""This script will install matplotlib to a virtual environment to
+faciltate testing."""
+import shutil, os, sys
+from subprocess import Popen, PIPE, STDOUT
+
+from _buildbot_util import check_call
+
+TARGET=os.path.abspath('PYmpl')
+
+if not os.path.exists(TARGET):
+ raise RuntimeError('the virtualenv target directory was not found')
+
+TARGET_py = os.path.join(TARGET,'bin','python')
+check_call('%s run-mpl-test.py --all'%TARGET_py,
+ cwd='test')
Added: trunk/matplotlib/test/_buildbot_util.py
===================================================================
--- trunk/matplotlib/test/_buildbot_util.py (rev 0)
+++ trunk/matplotlib/test/_buildbot_util.py 2009-08-23 05:18:45 UTC (rev 7535)
@@ -0,0 +1,20 @@
+"""Module to help _buildbot_*.py scripts."""
+
+import shutil, os, sys
+from subprocess import Popen, PIPE, STDOUT
+
+def check_call(args,**kwargs):
+ # print
+ # print args
+ # print '**kwargs'
+ # print kwargs
+ # print
+
+ # This use of Popen is copied from matplotlib.texmanager (Use of
+ # close_fds seems a bit mysterious.)
+
+ p = Popen(args, shell=True,
+ close_fds=(sys.platform!='win32'),**kwargs)
+ p.wait()
+ if p.returncode!=0:
+ raise RuntimeError('returncode is %s'%p.returncode)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-23 18:59:16
|
Revision: 7543
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7543&view=rev
Author: jdh2358
Date: 2009-08-23 18:59:07 +0000 (Sun, 23 Aug 2009)
Log Message:
-----------
fixes to sage build slave
Modified Paths:
--------------
trunk/matplotlib/test/README.build_slaves
trunk/matplotlib/test/_buildbot_mac_sage.sh
Modified: trunk/matplotlib/test/README.build_slaves
===================================================================
--- trunk/matplotlib/test/README.build_slaves 2009-08-23 18:44:35 UTC (rev 7542)
+++ trunk/matplotlib/test/README.build_slaves 2009-08-23 18:59:07 UTC (rev 7543)
@@ -2,3 +2,9 @@
python source install with clean installs of numpy and mpl. Both of
these will need nose installed.
+Dependencies
+===================
+buildbot and twisted
+nose
+pil
+virtualenv
Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh
===================================================================
--- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-08-23 18:44:35 UTC (rev 7542)
+++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-08-23 18:59:07 UTC (rev 7543)
@@ -1,2 +1,10 @@
-#!/bin/sh
-PREFIX=/Users/jdh2358/devbb make -f make.osx mpl_install
+#!/bin/bash
+set -e
+export PYTHON=/Users/jdh2358/dev/bin/python
+export PREFIX=/Users/jdh2358/devbb
+export PYTHONPATH=${PREFIX}/lib/python2.6/site-packages:/Users/jdh2358/dev/lib/python2.6/site-packages
+
+make -f make.osx mpl_install
+echo ${PYTHONPATH}
+
+cd test && python run-mpl-test.py --all --keep-failed
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-23 19:12:41
|
Revision: 7545
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7545&view=rev
Author: jdh2358
Date: 2009-08-23 19:12:30 +0000 (Sun, 23 Aug 2009)
Log Message:
-----------
flush config dir and use rc on build slaves
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_mac_sage.sh
trunk/matplotlib/test/matplotlibrc
Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh
===================================================================
--- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-08-23 19:12:20 UTC (rev 7544)
+++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-08-23 19:12:30 UTC (rev 7545)
@@ -1,9 +1,11 @@
#!/bin/bash
set -e
-export PYTHON=/Users/jdh2358/dev/bin/python
-export PREFIX=/Users/jdh2358/devbb
-export PYTHONPATH=${PREFIX}/lib/python2.6/site-packages:/Users/jdh2358/dev/lib/python2.6/site-packages
+rm -rf ${HOME}/.matplotlib/*
+export PYTHON=${HOME}/dev/bin/python
+export PREFIX=${HOME}/devbb
+export PYTHONPATH=${PREFIX}/lib/python2.6/site-packages:${HOME}/dev/lib/python2.6/site-packages
+
make -f make.osx mpl_install
echo ${PYTHONPATH}
Modified: trunk/matplotlib/test/matplotlibrc
===================================================================
--- trunk/matplotlib/test/matplotlibrc 2009-08-23 19:12:20 UTC (rev 7544)
+++ trunk/matplotlib/test/matplotlibrc 2009-08-23 19:12:30 UTC (rev 7545)
@@ -1,3 +1,3 @@
-#This is an empty matplotlibrc so that the tests use the
-#matplotlib default config and not the user's config. This keeps
-#settings like font sizes from causing the image comparison tests to fail.
+backend : Agg
+font.family : sans-serif
+font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-08-30 04:44:05
|
Revision: 7592
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7592&view=rev
Author: astraw
Date: 2009-08-30 04:43:54 +0000 (Sun, 30 Aug 2009)
Log Message:
-----------
testing: use standard nose mechanism for printing test name
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_test.py
trunk/matplotlib/test/mplTest/MplNosePlugin.py
Modified: trunk/matplotlib/test/_buildbot_test.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test.py 2009-08-30 03:45:21 UTC (rev 7591)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-08-30 04:43:54 UTC (rev 7592)
@@ -13,5 +13,5 @@
TARGET_py = os.path.join(TARGET,'bin','python')
check_call('%s -c "import shutil,matplotlib; x=matplotlib.get_configdir(); shutil.rmtree(x)"'%TARGET_py)
-check_call('%s run-mpl-test.py --all --keep-failed'%TARGET_py,
+check_call('%s run-mpl-test.py --verbose --all --keep-failed'%TARGET_py,
cwd='test')
Modified: trunk/matplotlib/test/mplTest/MplNosePlugin.py
===================================================================
--- trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009-08-30 03:45:21 UTC (rev 7591)
+++ trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009-08-30 04:43:54 UTC (rev 7592)
@@ -702,10 +702,6 @@
rmdir( self.outputDir )
mkdir( self.outputDir, recursive = True )
- # sys.stdout.write( "%s\n %s \n" % (test.id(), test.shortDescription()) )
- print "%s" % (test.id())
- print " %s" % (test.shortDescription())
-
#--------------------------------------------------------------------
def stopContext( self, context ):
"""Called after the tests in a context have run and the context has been
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-08-31 02:48:50
|
Revision: 7611
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7611&view=rev
Author: jdh2358
Date: 2009-08-31 02:48:42 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
update known good baselines using freetype 2.3.5
Modified Paths:
--------------
trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
trunk/matplotlib/test/test_matplotlib/baseline/TestTickers/RRuleLocator_bounds.png
trunk/matplotlib/test/test_plots/baseline/TestAnnotation/offset_points.png
trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png
trunk/matplotlib/test/test_plots/baseline/TestPlot/shaped_data.png
trunk/matplotlib/test/test_plots/baseline/TestPlot/single_date.png
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestAxes/empty_datetime.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_matplotlib/baseline/TestTickers/RRuleLocator_bounds.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestAnnotation/offset_points.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestFill/fill_units.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestPlot/const_xy.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestPlot/shaped_data.png
===================================================================
(Binary files differ)
Modified: trunk/matplotlib/test/test_plots/baseline/TestPlot/single_date.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-09-07 16:32:37
|
Revision: 7673
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7673&view=rev
Author: astraw
Date: 2009-09-07 16:32:28 +0000 (Mon, 07 Sep 2009)
Log Message:
-----------
testing: remove previous test images, preventing upload of removed tests
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_mac_sage.sh
trunk/matplotlib/test/_buildbot_test.py
Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh
===================================================================
--- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-09-07 14:09:01 UTC (rev 7672)
+++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-09-07 16:32:28 UTC (rev 7673)
@@ -11,4 +11,6 @@
make -f make.osx mpl_install
echo ${PYTHONPATH}
-cd test && python run-mpl-test.py --verbose --all --keep-failed
+cd test
+rm -f failed-diff-*.png
+python run-mpl-test.py --verbose --all --keep-failed
Modified: trunk/matplotlib/test/_buildbot_test.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test.py 2009-09-07 14:09:01 UTC (rev 7672)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-09-07 16:32:28 UTC (rev 7673)
@@ -1,6 +1,6 @@
"""This script will install matplotlib to a virtual environment to
faciltate testing."""
-import shutil, os, sys
+import shutil, os, sys, glob
from subprocess import Popen, PIPE, STDOUT
from _buildbot_util import check_call
@@ -13,5 +13,10 @@
TARGET_py = os.path.join(TARGET,'bin','python')
check_call('%s -c "import shutil,matplotlib; x=matplotlib.get_configdir(); shutil.rmtree(x)"'%TARGET_py)
+
+previous_test_images = glob.glob(os.path.join('test','failed-diff-*.png'))
+for fname in previous_test_images:
+ os.unlink(fname)
+
check_call('%s run-mpl-test.py --verbose --all --keep-failed'%TARGET_py,
cwd='test')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-09-07 20:06:16
|
Revision: 7698
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7698&view=rev
Author: astraw
Date: 2009-09-07 20:06:06 +0000 (Mon, 07 Sep 2009)
Log Message:
-----------
test conversion: remove old mplTest nose extensions
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_test.py
trunk/matplotlib/test/run-mpl-test.py
Removed Paths:
-------------
trunk/matplotlib/test/mplTest/MplNosePlugin.py
trunk/matplotlib/test/mplTest/MplTestCase.py
trunk/matplotlib/test/mplTest/__init__.py
trunk/matplotlib/test/mplTest/directories.py
trunk/matplotlib/test/mplTest/path_utils.py
Modified: trunk/matplotlib/test/_buildbot_test.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test.py 2009-09-07 20:05:54 UTC (rev 7697)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-09-07 20:06:06 UTC (rev 7698)
@@ -18,5 +18,5 @@
for fname in previous_test_images:
os.unlink(fname)
-check_call('%s run-mpl-test.py --verbose --all --keep-failed'%TARGET_py,
+check_call('%s run-mpl-test.py --verbose --all'%TARGET_py,
cwd='test')
Deleted: trunk/matplotlib/test/mplTest/MplNosePlugin.py
===================================================================
--- trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009-09-07 20:05:54 UTC (rev 7697)
+++ trunk/matplotlib/test/mplTest/MplNosePlugin.py 2009-09-07 20:06:06 UTC (rev 7698)
@@ -1,838 +0,0 @@
-#=======================================================================
-
-import os
-import sys
-import shutil
-import os.path
-import optparse
-
-import nose.case
-from nose.plugins import Plugin
-
-from path_utils import *
-import directories as dirs
-from MplTestCase import MplTestCase
-from matplotlib.testing.noseclasses import KnownFailureTest
-
-#=======================================================================
-
-__all__ = [ 'MplNosePlugin' ]
-
-#=======================================================================
-def getInstance( test ):
- """Given a nose test case, will return the actual unit test instance.
-
- We do this with a function call in case the method for getting the
- actual unit test instance needs to change.
- """
- assert isinstance( test, nose.case.Test )
-
- if isinstance( test.test, nose.case.MethodTestCase ):
- return test.test.inst
- elif isinstance( test.test, nose.case.FunctionTestCase ):
- return test.test.test
- # elif isinstance( test.test, unittest.TestCase ):
- else:
- return test.test
-
-
-#=======================================================================
-class MplNosePlugin( Plugin ):
-
- enabled = True
- name = "MplNosePlugin"
- score = 0
-
- KEEP_NONE = 0
- KEEP_FAIL = 1
- KEEP_ALL = 2
-
- TEST_ERRORED = -1
- TEST_FAILED = 0
- TEST_KNOWN_FAILED = 1
- TEST_PASSED = 2
-
- #--------------------------------------------------------------------
- # Some 'property' functions
- def getRootDir( self ):
- # The bottom directory of the stack is the root directory.
- return self.dirStack[0]
-
- def getInputDir( self ):
- return os.path.join( self.currentDir, dirs.inputDirName )
-
- def getOutputDir( self ):
- return os.path.join( self.currentDir, dirs.outputDirName )
-
- def getBaselineRootDir( self ):
- return os.path.join( self.currentDir, dirs.baselineDirName )
-
- def getSaveRootDir( self ):
- return os.path.join( self.currentDir, dirs.saveDirName )
-
- rootDir = property( getRootDir )
- inputDir = property( getInputDir )
- outputDir = property( getOutputDir )
- baselineRootDir = property( getBaselineRootDir )
- saveRootDir = property( getSaveRootDir )
-
- def getBaselineDir( self, test ):
- t = getInstance( test )
- return os.path.join( self.baselineRootDir, t.__class__.__name__ )
-
- def getSaveDir( self, test ):
- t = getInstance( test )
- return os.path.join( self.saveRootDir, t.__class__.__name__ )
-
- #--------------------------------------------------------------------
- def saveResults( self, test ):
- """Save the output directory for the gived test."""
- saveDir = self.getSaveDir( test )
- if not os.path.exists( saveDir ):
- mkdir( saveDir, recursive = True )
-
- outDir = getInstance( test ).outputDir
-
- for fname in walk( outDir ):
- if os.path.isdir( fname ):
- shutil.copytree( fname, saveDir )
- else:
- shutil.copy( fname, saveDir )
-
- #--------------------------------------------------------------------
- def filterTestItem( self, item ):
- """Return true if you want the main test selector to collect tests from
- this class, false if you don't, and None if you don't care.
-
- Parameters:
- item : An instance of the testable item that has a 'tag' attribute.
- """
-
- reallyWant = False
- reallyDontWant = False
-
- if hasattr( item, 'tags' ):
- itemTags = item.tags
- else:
- itemTags = []
-
- for tag in self.skipTags:
- if tag in itemTags:
- reallyDontWant = True
- break
-
- for tag in self.includeTags:
- if tag in itemTags:
- reallyWant = True
- else:
- reallyDontWant = True
- break
-
- if self.includeTags and not itemTags:
- reallyDontWant = True
-
- if reallyDontWant:
- return False
- if reallyWant:
- return True
-
- return None
-
- #--------------------------------------------------------------------
- def addError( self, test, err ):
- """Called when a test raises an uncaught exception. DO NOT return a value
- unless you want to stop other plugins from seeing that the test has
- raised an error.
-
- Parameters:
- test : nose.case.Test
- the test case
- err : 3-tuple
- sys.exc_info() tuple
- """
- (type, value, traceback) = err
- if isinstance(value,KnownFailureTest):
- self.testResults.append( (test, self.TEST_KNOWN_FAILED, err) )
- else:
- self.testResults.append( (test, self.TEST_ERRORED, err) )
-
- #--------------------------------------------------------------------
- def addFailure( self, test, err ):
- """Called when a test fails. DO NOT return a value unless you want to
- stop other plugins from seeing that the test has failed.
-
- Parameters:
- test : nose.case.Test
- the test case
- err : 3-tuple
- sys.exc_info() tuple
- """
- self.testResults.append( (test, self.TEST_FAILED, err) )
-
- #--------------------------------------------------------------------
- def addSuccess( self, test ):
- """Called when a test passes. DO NOT return a value unless you want to
- stop other plugins from seeing the passing test.
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- self.testResults.append( (test, self.TEST_PASSED, None) )
-
- #--------------------------------------------------------------------
- def afterContext( self ):
- """Called after a context (generally a module) has been lazy-loaded,
- imported, setup, had its tests loaded and executed, and torn down.
- """
- return None
-
- #--------------------------------------------------------------------
- def afterDirectory( self, path ):
- """Called after all tests have been loaded from directory at path and run.
-
- Parameters:
- path : string
- the directory that has finished processing
- """
- # Set the current directory to the previous directory
- self.currentDir = self.dirStack.pop()
- chdir( self.currentDir )
- return None
-
- #--------------------------------------------------------------------
- def afterImport( self, filename, module ):
- """Called after module is imported from filename. afterImport is called
- even if the import failed.
-
- Parameters:
- filename : string
- The file that was loaded
- module : string
- The name of the module
- """
- return None
-
- #--------------------------------------------------------------------
- def afterTest( self, test ):
- """Called after the test has been run and the result recorded
- (after stopTest).
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- return None
-
- #--------------------------------------------------------------------
- def beforeContext( self ):
- """Called before a context (generally a module) is examined. Since the
- context is not yet loaded, plugins don't get to know what the
- context is; so any context operations should use a stack that is
- pushed in beforeContext and popped in afterContext to ensure they
- operate symmetrically.
-
- beforeContext and afterContext are mainly useful for tracking and
- restoring global state around possible changes from within a
- context, whatever the context may be. If you need to operate on
- contexts themselves, see startContext and stopContext, which are
- passed the context in question, but are called after it has been
- loaded (imported in the module case).
- """
- return None
-
- #--------------------------------------------------------------------
- def beforeDirectory( self, path ):
- """Called before tests are loaded from directory at path.
-
- Parameters:
- path : string
- the directory that is about to be processed
- """
- # Save the cuurent directory and set to the new directory.
- self.dirStack.append( self.currentDir )
- self.currentDir = path
- chdir( self.currentDir )
-
- # Remove any existing 'saved-results' directory
- #NOTE: We must do this after setting 'self.currentDir'
- rmdir( self.saveRootDir )
-
- return None
-
- #--------------------------------------------------------------------
- def beforeImport( self, filename, module ):
- """Called before module is imported from filename.
-
- Parameters:
- filename : string
- The file that will be loaded
- module : string
- The name of the module found in file
- """
- return None
-
- #--------------------------------------------------------------------
- def beforeTest( self, test ):
- """Called before the test is run (before startTest).
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- return None
-
- #--------------------------------------------------------------------
- def begin( self ):
- """Called before any tests are collected or run. Use this to perform
- any setup needed before testing begins.
- """
- return None
-
- #--------------------------------------------------------------------
- def configure( self, options, conf ):
- """Called after the command line has been parsed, with the parsed
- options and the config container. Here, implement any config
- storage or changes to state or operation that are set by command
- line options.
-
- Do not return a value from this method unless you want to stop all
- other plugins from being configured.
- """
- self.includeTags = [ t for t in options.mpl_process_tags ]
- self.skipTags = [ t for t in options.mpl_skip_tags ]
- self.keepLevel = options.mpl_keep
-
- self.currentDir = os.getcwd()
- self.dirStack = []
-
- self.testResults = []
-
- #--------------------------------------------------------------------
- def describeTest( self, test ):
- """Return a test description. Called by nose.case.Test.shortDescription.
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- return None
-
- #--------------------------------------------------------------------
- def finalize( self, result ):
- """Called after all report output, including output from all plugins,
- has been sent to the stream. Use this to print final test results
- or perform final cleanup. Return None to allow other plugins to
- continue printing, any other value to stop them.
-
- Note
- When tests are run under a test runner other than
- nose.core.TextTestRunner, for example when tests are run via
- 'python setup.py test', this method may be called before the default
- report output is sent.
- """
- return None
-
- #--------------------------------------------------------------------
- def formatError( self, test, err ):
- """Called in result.addError, before plugin.addError. If you want to
- replace or modify the error tuple, return a new error tuple.
-
- Parameters:
- test : nose.case.Test
- the test case
- err : 3-tuple
- sys.exc_info() tuple
- """
- return err
-
- #--------------------------------------------------------------------
- def formatFailure( self, test, err ):
- """Called in result.addFailure, before plugin.addFailure. If you want to
- replace or modify the error tuple, return a new error tuple. Since
- this method is chainable, you must return the test as well, so you
- you'll return something like:
- return (test, err)
-
- Parameters:
- test : nose.case.Test
- the test case
- err : 3-tuple
- sys.exc_info() tuple
- """
- return None
-
- #--------------------------------------------------------------------
- def handleError( self, test, err ):
- """Called on addError. To handle the error yourself and prevent normal
- error processing, return a true value.
-
- Parameters:
- test : nose.case.Test
- the test case
- err : 3-tuple
- sys.exc_info() tuple
- """
- if (self.keepLevel == self.KEEP_FAIL) or (self.keepLevel == self.KEEP_ALL):
- self.saveResults( test )
-
- return None
-
- #--------------------------------------------------------------------
- def handleFailure( self, test, err ):
- """Called on addFailure. To handle the failure yourself and prevent
- normal failure processing, return a true value.
-
- Parameters:
- test : nose.case.Test
- the test case
- err : 3-tuple
- sys.exc_info() tuple
- """
- if (self.keepLevel == self.KEEP_FAIL) or (self.keepLevel == self.KEEP_ALL):
- self.saveResults( test )
-
- return None
-
- #--------------------------------------------------------------------
- def loadTestsFromDir( self, path ):
- """Return iterable of tests from a directory. May be a generator.
- Each item returned must be a runnable unittest.TestCase
- (or subclass) instance or suite instance. Return None if your
- plugin cannot collect any tests from directory.
-
- Parameters:
- path : string
- The path to the directory.
- """
- return None
-
- #--------------------------------------------------------------------
- def loadTestsFromFile( self, filename ):
- """Return tests in this file. Return None if you are not interested in
- loading any tests, or an iterable if you are and can load some. May
- be a generator. If you are interested in loading tests from the file
- and encounter no errors, but find no tests, yield False or
- return [False].
-
- Parameters:
- filename : string
- The full path to the file or directory.
- """
- return None
-
- #--------------------------------------------------------------------
- def loadTestsFromModule( self, module ):
- """Return iterable of tests in a module. May be a generator. Each
- item returned must be a runnable unittest.TestCase (or subclass)
- instance. Return None if your plugin cannot collect any tests
- from module.
-
- Parameters:
- module : python module
- The module object
- """
- return None
-
- #--------------------------------------------------------------------
- def loadTestsFromName( self, name, module=None, importPath=None ):
- """Return tests in this file or module. Return None if you are not able
- to load any tests, or an iterable if you are. May be a generator.
-
- Parameters:
- name : string
- The test name. May be a file or module name plus a test
- callable. Use split_test_name to split into parts. Or it might
- be some crazy name of your own devising, in which case, do
- whatever you want.
- module : python module
- Module from which the name is to be loaded
- """
- return None
-
- #--------------------------------------------------------------------
- def loadTestsFromNames( self, names, module=None ):
- """Return a tuple of (tests loaded, remaining names). Return None if you
- are not able to load any tests. Multiple plugins may implement
- loadTestsFromNames; the remaining name list from each will be passed
- to the next as input.
-
- Parameters:
- names : iterable
- List of test names.
- module : python module
- Module from which the names are to be loaded
- """
- return None
-
- #--------------------------------------------------------------------
- def loadTestsFromTestCase( self, cls ):
- """Return tests in this test case class. Return None if you are not able
- to load any tests, or an iterable if you are. May be a generator.
-
- Parameters:
- cls : class
- The test case class. Must be subclass of unittest.TestCase.
- """
- return None
-
- #--------------------------------------------------------------------
- def loadTestsFromTestClass( self, cls ):
- """Return tests in this test class. Class will not be a unittest.TestCase
- subclass. Return None if you are not able to load any tests, an
- iterable if you are. May be a generator.
-
- Parameters:
- cls : class
- The test class. Must NOT be subclass of unittest.TestCase.
- """
- return None
-
- #--------------------------------------------------------------------
- def makeTest( self, obj, parent ):
- """Given an object and its parent, return or yield one or more test
- cases. Each test must be a unittest.TestCase (or subclass) instance.
- This is called before default test loading to allow plugins to load
- an alternate test case or cases for an object. May be a generator.
-
- Parameters:
- obj : any object
- The object to be made into a test
- parent : class, module or other object
- The parent of obj (eg, for a method, the class)
- """
- return None
-
- #--------------------------------------------------------------------
- def options( self, parser, env = os.environ ):
- """Called to allow plugin to register command line options with the parser.
-
- Do not return a value from this method unless you want to stop all other
- plugins from setting their options.
-
- NOTE: By default, parser is a Python optparse.OptionParser instance.
- """
- helpMsg = "The following are options specific to the matplotlib test harness"
- group = optparse.OptionGroup( parser, "Matplotlib Options", helpMsg )
-
- # Options to handle tags
- helpMsg = "Will only run test cases that have the specified tag. Each "
- helpMsg += "test case should have a 'tag' attribute (if a case does not h"
- helpMsg += "ave one, then it is assumed to be an empty list). The 'tag' "
- helpMsg += "attribute is a list of strings, where each value is a "
- helpMsg += "representative propery of the test case. Example tags are "
- helpMsg += "'qt' or 'units'. This can be specified multiple times."
- group.add_option( '-t', '--with-tag',
- action = 'append', type = 'string', dest = 'mpl_process_tags',
- default = [], metavar = 'TAG', help = helpMsg )
-
- helpMsg = "This will run those test cases that do not have the specified tags."
- group.add_option( '--without-tag',
- action = 'append', type = 'string', dest = 'mpl_skip_tags',
- default = [], metavar = 'TAG', help = helpMsg )
-
-
- # Some Miscellaneous options
- helpMsg = "This will remove all output files, saved results, and .pyc files. "
- helpMsg += "If this is specified, no other processing will be performed."
- group.add_option( '--clean',
- action = "store_true", dest = "mpl_clean",
- default = False, help = helpMsg )
-
- helpMsg = "This will run all test programs regardless of working directory."
- group.add_option( '--all',
- action = "store_true", dest = "mpl_all",
- default = False, help = helpMsg )
-
-
- # Options to handle generated data files
- helpMsg = "Keep any generated output files in a directory called "
- helpMsg += "'saved-results'. This directory will be created if it "
- helpMsg += "doesn't already exist. This directory is in the same "
- helpMsg += "location as the test case whose results are being saved."
- group.add_option( '--keep',
- action = "store_const", dest = "mpl_keep",
- default = self.KEEP_NONE, const = self.KEEP_ALL, help = helpMsg )
-
- helpMsg = "This acts just like '--keep' except will only keeps the results "
- helpMsg += "from tests that error or fail."
- group.add_option( '--keep-failed',
- action = "store_const", dest = "mpl_keep",
- default = self.KEEP_NONE, const = self.KEEP_FAIL, help = helpMsg )
-
-
- # Options to create a test case file
- helpMsg = "Creates a template test case file in the current directory "
- helpMsg += "with the name TestFoo. Where 'Foo' is the provided test name."
- group.add_option( '--make-test',
- action = 'store', dest = 'mpl_make_test',
- default = False, metavar = 'testName', help = helpMsg )
-
-
- parser.add_option_group( group )
-
- #--------------------------------------------------------------------
- def prepareTest( self, test ):
- """Called before the test is run by the test runner. Please note the
- article the in the previous sentence: prepareTest is called only once,
- and is passed the test case or test suite that the test runner will
- execute. It is not called for each individual test case. If you return
- a non-None value, that return value will be run as the test. Use this
- hook to wrap or decorate the test with another function. If you need
- to modify or wrap individual test cases, use prepareTestCase instead.
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- return None
-
- #--------------------------------------------------------------------
- def prepareTestCase( self, test ):
- """Prepare or wrap an individual test case. Called before execution of
- the test. The test passed here is a nose.case.Test instance; the case
- to be executed is in the test attribute of the passed case. To modify
- the test to be run, you should return a callable that takes one
- argument (the test result object) -- it is recommended that you do not
- side-effect the nose.case.Test instance you have been passed.
-
- Keep in mind that when you replace the test callable you are replacing
- the run() method of the test case -- including the exception handling
- and result calls, etc.
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- # Save the dir names in the test class instance to make it available
- # to the individual test cases.
- t = getInstance( test )
- t.inputDir = self.inputDir
- t.outputDir = self.outputDir
- t.baselineDir = self.getBaselineDir( test )
- t.workingDir = self.currentDir
-
- return None
-
- #--------------------------------------------------------------------
- def prepareTestLoader( self, loader ):
- """Called before tests are loaded. To replace the test loader, return a
- test loader. To allow other plugins to process the test loader,
- return None. Only one plugin may replace the test loader. Only valid
- when using nose.TestProgram.
-
- Parameters:
- loader : nose.loader.TestLoader or other loader instance
- the test loader
- """
- return None
-
- #--------------------------------------------------------------------
- def prepareTestResult( self, result ):
- """Called before the first test is run. To use a different test result
- handler for all tests than the given result, return a test result
- handler. NOTE however that this handler will only be seen by tests,
- that is, inside of the result proxy system. The TestRunner and
- TestProgram -- whether nose's or other -- will continue to see the
- original result handler. For this reason, it is usually better to
- monkeypatch the result (for instance, if you want to handle some
- exceptions in a unique way). Only one plugin may replace the result,
- but many may monkeypatch it. If you want to monkeypatch and stop
- other plugins from doing so, monkeypatch and return the patched result.
-
- Parameters:
- result : nose.result.TextTestResult or other result instance
- the test result
- """
- return None
-
- #--------------------------------------------------------------------
- def prepareTestRunner( self, runner ):
- """Called before tests are run. To replace the test runner, return a
- test runner. To allow other plugins to process the test runner,
- return None. Only valid when using nose.TestProgram.
-
- Parameters:
- runner : nose.core.TextTestRunner or other runner instance
- the test runner
- """
- return None
-
- #--------------------------------------------------------------------
- def report( self, stream ):
- """Called after all error output has been printed. Print your plugin's
- report to the provided stream. Return None to allow other plugins to
- print reports, any other value to stop them.
-
- Parameters:
- stream : file-like object
- stream object; send your output here
- """
- return None
-
- #--------------------------------------------------------------------
- def setOutputStream( self, stream ):
- """Called before test output begins. To direct test output to a new
- stream, return a stream object, which must implement a write(msg)
- method. If you only want to note the stream, not capture or redirect
- it, then return None.
-
- Parameters:
- stream : file-like object
- the original output stream
- """
- return None
-
- #--------------------------------------------------------------------
- def startContext( self, context ):
- """Called before context setup and the running of tests in the context.
- Note that tests have already been loaded from the context before this call.
-
- Parameters:
- context : module, class or other object
- the context about to be setup. May be a module or class, or
- any other object that contains tests.
- """
- return None
-
- #--------------------------------------------------------------------
- def startTest( self, test ):
- """Called before each test is run. DO NOT return a value unless you want
- to stop other plugins from seeing the test start.
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- # make sure there is a fresh output directory to use.
- rmdir( self.outputDir )
- mkdir( self.outputDir, recursive = True )
-
- #--------------------------------------------------------------------
- def stopContext( self, context ):
- """Called after the tests in a context have run and the context has been
- torn down.
-
- Parameters:
- context : module, class or other object
- the context that has just been torn down.
- """
- return None
-
- #--------------------------------------------------------------------
- def stopTest( self, test ):
- """Called after each test is run. DO NOT return a value unless you want
- to stop other plugins from seeing that the test has stopped.
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- assert test == self.testResults[-1][0]
-
- if self.keepLevel == self.KEEP_ALL:
- self.saveResults( test )
-
- # KEEP_FAIL is handled by the 'handleError' and 'handleFailed' methods.
-
- rmdir( self.outputDir )
-
- #--------------------------------------------------------------------
- def testName( self, test ):
- """Return a short test name. Called by nose.case.Test.__str__.
-
- Parameters:
- test : nose.case.Test
- the test case
- """
- return None
-
- #-----------------------------...
[truncated message content] |
|
From: <as...@us...> - 2009-09-07 20:18:39
|
Revision: 7699
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7699&view=rev
Author: astraw
Date: 2009-09-07 20:18:32 +0000 (Mon, 07 Sep 2009)
Log Message:
-----------
test conversion: remove empy directories
Removed Paths:
-------------
trunk/matplotlib/test/mplTest/
trunk/matplotlib/test/test_artists/
trunk/matplotlib/test/test_backends/
trunk/matplotlib/test/test_basemap/
trunk/matplotlib/test/test_cxx/
trunk/matplotlib/test/test_mathtext/
trunk/matplotlib/test/test_matplotlib/
trunk/matplotlib/test/test_numerix/
trunk/matplotlib/test/test_plots/
trunk/matplotlib/test/test_pylab/
trunk/matplotlib/test/test_transforms/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-09-07 20:27:52
|
Revision: 7700
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7700&view=rev
Author: astraw
Date: 2009-09-07 20:27:44 +0000 (Mon, 07 Sep 2009)
Log Message:
-----------
test conversion: remove infrastructure cruft
Modified Paths:
--------------
trunk/matplotlib/test/README.txt
trunk/matplotlib/test/_buildbot_mac_sage.sh
trunk/matplotlib/test/_buildbot_test.py
Removed Paths:
-------------
trunk/matplotlib/test/consolidate_diff_images.sh
trunk/matplotlib/test/movegood.py
trunk/matplotlib/test/run-mpl-test.py
Modified: trunk/matplotlib/test/README.txt
===================================================================
--- trunk/matplotlib/test/README.txt 2009-09-07 20:18:32 UTC (rev 7699)
+++ trunk/matplotlib/test/README.txt 2009-09-07 20:27:44 UTC (rev 7700)
@@ -1,299 +1,2 @@
-========================================================================
- matplotlib test structure
-========================================================================
-
-===== How To Use
-
-= Running
-
-Run the 'run-mpl-test.py' script to execute the test harness. This must
-be run with the version of python that you wish to test matplotlib with.
-This means that it must have nose installed (and PIL if image comparison
-is to be done). By default this will pick up whatever python is on your
-path, so make sure it is the correct one.
-
-- Command-Line Options
-In addition to the standard nose command-line options, there are several
-specific to the matplotlib test harness. They are as follows:
-
- -t TAG, --with-tag=TAG
- Will only run test cases that have the specified tag.
- Each test case should have a 'tag' attribute (if a
- case does not have one, then it is assumed to be an
- empty list). The 'tag' attribute is a list of
- strings, where each value is a representative propery
- of the test case. Example tags are 'qt' or 'units'.
- This can be specified multiple times.
- --without-tag=TAG This will run those test cases that do not have the
- specified tags.
- --clean This will remove all output files and saved results.
- If this is specified, no other processing will be
- performed.
- --all This will runn all test programs regardless of working
- directory.
- --keep Keep any generated output files in a directory called
- 'saved-results'. This directory will be created if it
- doesn't already exist. This directory is in the same
- location as the test case whose results are being
- saved.
- --keep-failed This acts just like '--keep' except will only keeps
- the results from tests that error or fail.
- --make-test=testName
- Creates a template test case file in the current
- directory with the name TestFoo. Where 'Foo' is the
- provided test name.
-
-
-- Running Specific Tests
-In order to can specify the exact test case you want to run use the
-standard nose mechanism. For example, if you have the following setup:
-
-TestFoo.py
- def test_func():
- ...
-
- class TestFoo:
- def test_bar( self ):
- ...
- def test_bug( self ):
- ...
-
-Then to test everything in TestFoo.py do the following:
-$> run-mpl-test.py TestFoo.py
-
-To run all tests in the test class TestFoo do this:
-$> run-mpl-test.py TestFoo.py:TestFoo
-
-To run the specific 'test_bar' methodd do the following:
-$> run-mpl-test.py TestFoo.py:TestFoo.test_bar
-
-
-= Detecting Test Cases
-
-When running the matplotlib test script it will search for all tests
-in the current working directory and below (unless '--all' is specified).
-This is provided that the current working directory is a sub-directory
-of the matplotlib test directory. In the event that it is not, then the
-matplotlib root test directory will be used and all appropriate test cases
-will be run.
-
-This will not search outside of the test structure and will not look in
-the mplTest module. This will only search for test cases in the root
-test directory and any of its sub-directories.
-
-= Saving Results
-
-When using the keep flag any generated files in the 'output' directory
-are copied to the 'saved-results/<classname>' directory, where <classname>
-is the name of the unit-test class. This means that for each test case
-within a given test class, all output files should have unique names.
-
-The 'saved-results' directory will always contain the results from the
-last test run. This is considered a volatile directory since running
-the test cases without the '--keep' flag will remove any existing
-'saved-results' directory. This is to ensure the integrity of the
-saved results, they will always match the last test run.
-
-= Filtering Tests
-
-In the case of filtering via tags, a unit-test cane have multiple tags.
-When running the test program if any tags are specified as 'skip' then
-this will take precedence over any tags that might say 'process'. For
-example, if a test case has both the 'gui' and 'qt' tag, but the command-
-line is specified with the following flags:
- '--with-tag=gui --without-tag=qt'
-then the example test case will not be run because it matches the skip
-tag.
-
-
-===== Directory Structure
-
-There are several directories in the matplotlib test structure. The first
-directory is the 'mplTest' directory. This is the matplotlib test module
-and contains the various python scripts that the test harness needs to
-run. The remaining directories are as follows and contain the various test
-cases for matplotlib.
-
-mplTest
- This directory does not contain any test cases, rather it is the location
- of the matplotlib specific utilities for performing unit tests.
-
-test_artists
- This directory contains tests that focus on the rendering aspects of
- the various artists. Essentially the artist derived functionality.
-
-test_backends
- This directory contains various tests that focus on making sure the
- various backend targets work.
-
-test_basemap
- This directory contains test cases that excercise the basemap add-on
- module.
-
-test_cxx
- This directoy contains tests that focus on testing the interface of
- the compiled code contained in matplotlib.
-
-test_mathtext
- This directory contains tests that focus on excercising the mathtext
- sub-system.
-
-test_numerix
- This directory contains tests that focus on validating the numerix
- component.
-
-test_plots
- This directory contains tests that validate the various plot funtions.
-
-test_pylab
- This directory has pylab specific test cases.
-
-test_transforms
- This directory has test cases that focus on testing the various
- transformation and projection functions.
-
-test_matplotlib
- This directory has all other test cases. This contins test that focus
- on making sure that Axis, Axes, Figure, etc are all acting properly. This
- has test cases that are general to the overall funtionality of matplotlib.
-
-
-===== Writing Test Cases
-
-= The Test Case
-
-As per the nose implementation, a test case is ultimately any function that
-has the phrase 'test' in its name. The matplotlib cases however are grouped
-into directories, by what is being tested, and from there are grouped into
-classes (one class per file), by similarity.
-
-It is desireable that all matplotlib tests follow the same structure to
-not only facilitate the writing of test cases, but to make things easier
-for maintaining them and keeping things uniform.
-
-There is a class 'MplTestCase' provided to be the base class for all matplotlib
-test classes. This class provides some extra functionality in the form of
-verification functions and test data management.
-
-= Comparison Functions
-
-There are several methods provided for testing whether or not a particular
-test case should fail or succeed. The following methods are provided by
-the base matplotlib test class:
-
-- MplTestCase.checkEq( expected, actual, msg = "" )
- Fail if the values are not equal, with the given message.
-
-- MplTestCase.checkNeq( expected, actual, msg = "" )
- Fail if the values are equal, with the given message.
-
-- MplTestCase.checkClose( expected, actual, relTol=None, absTol=None, msg="" )
- Fail if the floating point values are not close enough, with the given message.
- You can specify a relative tolerance, absolute tolerance, or both.
-
-- MplTestCase.checkImage( filename, tol = 1.0e-3, msg = "" )
- Check to see if the image is similair to the one stored in the baseline
- directory. filename can be a fully qualified name (via the 'outFile' method),
- or it can be the name of the file (to be passed into the 'outFile' method).
- The default tolerance is typically fine, but might need to be adjusted in some
- cases (see the 'compareImages' function for more details). Fails with
- the specified message.
-
-Note that several of the tests will perform image comparison for validation
-of a specific plot. Though not 100% accurate it at least flags potential
-failures and signals a human to come and take a closer look. If an image has
-changed and after a human deems the change is acceptable, then updating the
-baseline image with the appropriate image from the 'saved-results' directory
-(when using the '--keep' or '--keep-failed' command-line arguments) will make
-the test pass properly.
-
-Image comparison depends on the python imaging library (PIL) being installed.
-If PIL is not installed, then any test cases that rely on it will not
-pass. To not run these test cases, then pass the '--without-tag=PIL'
-option on the command-line.
-
-= Directories
-
-Input data files for a given test case should be place in a directory
-called 'inputs' with the test case that uses it. A convienence function
-is provided with each test class for accessing input files.
-
-For example if a test case has an input file of the name 'inputs.txt'
-you can get the path to the file by calling 'self.inFile("inputs.txt")'.
-This is to allow for a uniform convention that all test cases can follow.
-
-Output files are handled just like input files with the exception that
-they are written to the 'output' directory and the path name can be
-had by calling 'self.outFile'. It is more important to use this mechanism
-for getting the pathname for an output file because it allows for the
-management of cleaning up and saving generated output files (It also
-significantly reduces the probability of typo errors when specifying
-where to place the files).
-
-A Third and final directory used by the test cases is the 'baseline'
-directory. This is where data files used for verifying test results
-are stored. The path name can be had by using the 'self.baseFile'
-method.
-
-Accessing these directories can be made simple (and reduce the chance of a
-typo) via the following MplTestCase methods:
-
-- MplTestCase.inFile( filename )
- Returns the full pathname of filename in the input data directory.
-
-- MplTestCase.outFile( filename )
- Returns the full pathname of filename in the output data directory.
-
-- MplTestCase.baseFile( filename )
- Returns the full pathname of filename in the baseline data directory.
-
-= Units
-
-Located in the mplTest directory is a set of unit classes. These classes
-are provided for testing the various unitized data interfaces that matplotlib
-supports (ie unit conversion). These are used because they provide a very
-strict enforcement of unitized data which will test the entire spectrum of how
-unitized data might be used (it is not always meaningful to convert to
-a float without specific units given). This allows us to test for cases that
-might accidentally be performing operations that really do not make sense
-physically for unitized data.
-
-The provided classes are as follows:
-- UnitDbl
- UnitDbl is essentially a unitized floating point number. It has a
- minimal set of supported units (enough for testing purposes). All
- of the mathematical operation are provided to fully test any behaviour
- that might occur with unitized data. Remeber that unitized data has
- rules as to how it can be applied to one another (a value of distance
- cannot be added to a value of time). Thus we need to guard against any
- accidental "default" conversion that will strip away the meaning of the
- data and render it neutered.
-
-- Epoch
- Epoch is different than a UnitDbl of time. Time is something that can be
- measured where an Epoch is a specific moment in time. Epochs are typically
- referenced as an offset from some predetermined epoch. Conceptally an Epoch
- is like saying 'January 1, 2000 at 12:00 UTC'. It is a specific
- time, but more importantly it is a time with a frame. In the example
- the frame is 'UTC'. This class is provided to test the functionality of
- matplotlib's various routines and mechanisms for dealing with datetimes.
-
-- Duration
- A difference of two epochs is a Duration. The distinction between a
- Duration and a UnitDbl of time is made because an Epoch can have different
- frames (or units). In the case of our test Epoch class the two allowed
- frames are 'UTC' and 'ET' (Note that these are rough estimates provided for
- testing purposes and should not be used in production code where accuracy
- of time frames is desired). As such a Duration also has a frame of
- reference and therefore needs to be called out as different that a simple
- measurement of time since a delta-t in one frame may not be the same in another.
-
-
-
-Updating after diff
-====================
-
- python run-mpl-test.py --all --keep-failed
- ./consolidate_diff_images.sh
- # check your images, decide which are good
- python movegood.py
+Please see doc/devel/coding_guide.rst for information about the
+testing infrastructure.
Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh
===================================================================
--- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-09-07 20:18:32 UTC (rev 7699)
+++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-09-07 20:27:44 UTC (rev 7700)
@@ -13,4 +13,4 @@
cd test
rm -f failed-diff-*.png
-python run-mpl-test.py --verbose --all --keep-failed
+python -c "import matplotlib; matplotlib.test(verbosity=2)"
Modified: trunk/matplotlib/test/_buildbot_test.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test.py 2009-09-07 20:18:32 UTC (rev 7699)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-09-07 20:27:44 UTC (rev 7700)
@@ -18,5 +18,5 @@
for fname in previous_test_images:
os.unlink(fname)
-check_call('%s run-mpl-test.py --verbose --all'%TARGET_py,
+check_call('%s -c "import matplotlib; matplotlib.test(verbosity=2)"'%TARGET_py,
cwd='test')
Deleted: trunk/matplotlib/test/consolidate_diff_images.sh
===================================================================
--- trunk/matplotlib/test/consolidate_diff_images.sh 2009-09-07 20:18:32 UTC (rev 7699)
+++ trunk/matplotlib/test/consolidate_diff_images.sh 2009-09-07 20:27:44 UTC (rev 7700)
@@ -1,7 +0,0 @@
-#!/bin/bash
-set -e
-
-TARGET_DIR="diff-images"
-rm -rf $TARGET_DIR
-mkdir $TARGET_DIR
-find . -name 'failed-diff-*png' -exec mv {} $TARGET_DIR/ \;
Deleted: trunk/matplotlib/test/movegood.py
===================================================================
--- trunk/matplotlib/test/movegood.py 2009-09-07 20:18:32 UTC (rev 7699)
+++ trunk/matplotlib/test/movegood.py 2009-09-07 20:27:44 UTC (rev 7700)
@@ -1,53 +0,0 @@
-import os, sys, glob, shutil
-import matplotlib.cbook as cbook
-
-savedresults_dir = 'saved-results'
-baseline_dir = 'baseline'
-diff_dir = 'diff-images'
-basename = 'failed-diff-'
-nbase = len(basename)
-
-failed = set()
-for fname in glob.glob(os.path.join(diff_dir, '%s*.png'%basename)):
- ind = fname.find(basename)
- fname = fname[ind+nbase:]
- failed.add(fname)
-
-datad = dict()
-for fpath in cbook.get_recursive_filelist('.'):
- if not fpath.endswith('.png'): continue
- if fpath.find(diff_dir)>0: continue
- rel_dir, fname = os.path.split(fpath)
-
-
- saved = fpath.find(savedresults_dir)>0
- baseline = fpath.find(baseline_dir)>0
-
- if saved:
- datad.setdefault(fname, [None,None])[0] = fpath
- elif baseline:
- datad.setdefault(fname, [None,None])[1] = fpath
-
-nfailed = len(failed)
-for ithis, fname in enumerate(sorted(failed)):
- data = datad.get(fname)
- if data is not None:
- saved, baseline = data
- #print ithis, fname, saved, baseline
- if saved is None:
- print 'could not find saved data for', fname
- elif baseline is None:
- print 'could not find baseline data for', fname
- else:
- x = raw_input('Copy %d of %d\n saved="%s" to\n baseline="%s" (n|Y):'%(ithis, nfailed, saved, baseline))
- if x.lower()=='y' or x=='':
- shutil.copy(saved, baseline)
- print ' copied'
- elif x.lower()=='n':
- print ' skipping'
- else:
- print ' skipping unrecognized response="%s"'%x
- print
-
- else:
- print 'could not find data for', fname
Deleted: trunk/matplotlib/test/run-mpl-test.py
===================================================================
--- trunk/matplotlib/test/run-mpl-test.py 2009-09-07 20:18:32 UTC (rev 7699)
+++ trunk/matplotlib/test/run-mpl-test.py 2009-09-07 20:27:44 UTC (rev 7700)
@@ -1,100 +0,0 @@
-#!/bin/env python
-"""
-
- TODO-NOTES:
- Command-line executable that runs the tests.
- -- nice report on test pass/fail status
- -- hooks to add coverage checking and reporting
-
- Utilities
- -- image comparison tools (non-PIL dependant)
-
-"""
-import os
-import sys
-import os.path
-
-# Save stdout/stderr
-originalStdout = sys.stdout
-originalStderr = sys.stderr
-
-# get the current directory and the root test directory
-cwd = os.path.abspath( os.getcwd() )
-root = os.path.dirname( os.path.abspath( sys.argv[0] ) )
-sys.path = [ root ] + sys.path
-
-# command-line arguments
-args = [ arg for arg in sys.argv ]
-
-# determine the actual working directory to use
-if root in cwd:
- working = cwd
-else:
- working = root
-
-if '--all' in args:
- working = root
-
-# print "DBG: mpl.test.run - cwd = '%s'" % (cwd)
-# print "DBG: mpl.test.run - root = '%s'" % (root)
-# print "DBG: mpl.test.run - working = '%s'" % (working)
-
-# make the working directory current
-os.chdir( working )
-
-import nose
-import nose.plugins.builtin
-import matplotlib
-from matplotlib.testing.noseclasses import KnownFailure
-
-for arg in args:
- # We need to do this here, because we do not actually want nose to start.
- if arg.startswith( '--make-test=' ):
- testname = arg[ 12: ]
- # Remove any surrounding quotation marks
- if (testname[0] == '"' and testname[-1] == '"') or \
- (testname[0] == "'" and testname[-1] == "'"):
- testname = testname[1:-1]
-
- filename = os.path.join( cwd, 'Test' + testname + '.py' )
- templName = os.path.join( root, 'mplTest', "TestTEMPLATE.py" )
-
- fin = open( templName, "r" )
- fout = open( filename, "w" )
-
- lines = fin.readlines()
- for line in lines:
- newline = line.replace( 'UNITTEST', testname )
- fout.write( newline )
-
- fin.close()
- fout.close()
-
- print "Generated '%s'" % (filename)
-
- sys.exit( 0 )
-
-### Run nose
-args.append('.')
-args.extend( matplotlib.default_test_modules )
-
-plugins = [plugin() for plugin in nose.plugins.builtin.plugins]
-plugins.extend( [ KnownFailure() ])
-
-success = nose.run( argv = args,
- plugins = plugins,
- )
-
-### do other stuff here
-
-
-# $> nosetests [-w <working_directory>]
-# Run a specific test
-# $> nosetests tests/test_stuff.py:test_function
-# $> nosetests tests/test_stuff.py:TestClass.test_method
-
-# Restore the original stdout/stderr
-sys.stdout = originalStdout
-sys.stderr = originalStderr
-
-sys.exit(not success)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-09-08 15:54:12
|
Revision: 7715
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7715&view=rev
Author: astraw
Date: 2009-09-08 15:54:06 +0000 (Tue, 08 Sep 2009)
Log Message:
-----------
buildbot: set exit code when running tests
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_mac_sage.sh
trunk/matplotlib/test/_buildbot_test.py
Modified: trunk/matplotlib/test/_buildbot_mac_sage.sh
===================================================================
--- trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-09-08 15:49:37 UTC (rev 7714)
+++ trunk/matplotlib/test/_buildbot_mac_sage.sh 2009-09-08 15:54:06 UTC (rev 7715)
@@ -13,4 +13,4 @@
cd test
rm -f failed-diff-*.png
-python -c "import matplotlib; matplotlib.test(verbosity=2)"
+python -c "import sys, matplotlib; success = matplotlib.test(verbosity=2); sys.exit(not success)"
Modified: trunk/matplotlib/test/_buildbot_test.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test.py 2009-09-08 15:49:37 UTC (rev 7714)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-09-08 15:54:06 UTC (rev 7715)
@@ -18,5 +18,5 @@
for fname in previous_test_images:
os.unlink(fname)
-check_call('%s -c "import matplotlib; matplotlib.test(verbosity=2)"'%TARGET_py,
+check_call('%s -c "import sys, matplotlib; success = matplotlib.test(verbosity=2); sys.exit(not success)"'%TARGET_py,
cwd='test')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-11-30 09:07:02
|
Revision: 7987
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7987&view=rev
Author: astraw
Date: 2009-11-30 09:06:48 +0000 (Mon, 30 Nov 2009)
Log Message:
-----------
buildbot test running: run tests in MPL root dir (bypasses weird bug with scons build)
Modified Paths:
--------------
trunk/matplotlib/test/_buildbot_test.py
trunk/matplotlib/test/_buildbot_test_postmortem.py
Modified: trunk/matplotlib/test/_buildbot_test.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test.py 2009-11-26 19:37:06 UTC (rev 7986)
+++ trunk/matplotlib/test/_buildbot_test.py 2009-11-30 09:06:48 UTC (rev 7987)
@@ -1,7 +1,6 @@
"""This script will install matplotlib to a virtual environment to
faciltate testing."""
-import shutil, os, sys, glob
-from subprocess import Popen, PIPE, STDOUT
+import os, glob
from _buildbot_util import check_call
@@ -13,10 +12,8 @@
TARGET_py = os.path.join(TARGET,'bin','python')
check_call('%s -c "import shutil,matplotlib; x=matplotlib.get_configdir(); shutil.rmtree(x)"'%TARGET_py)
-
-previous_test_images = glob.glob(os.path.join('test','failed-diff-*.png'))
+previous_test_images = glob.glob('failed-diff-*.png')
for fname in previous_test_images:
os.unlink(fname)
-check_call('%s -c "import sys, matplotlib; success = matplotlib.test(verbosity=2); sys.exit(not success)"'%TARGET_py,
- cwd='test')
+check_call('%s -c "import sys, matplotlib; success = matplotlib.test(verbosity=2); sys.exit(not success)"'%TARGET_py)
Modified: trunk/matplotlib/test/_buildbot_test_postmortem.py
===================================================================
--- trunk/matplotlib/test/_buildbot_test_postmortem.py 2009-11-26 19:37:06 UTC (rev 7986)
+++ trunk/matplotlib/test/_buildbot_test_postmortem.py 2009-11-30 09:06:48 UTC (rev 7987)
@@ -4,7 +4,7 @@
This is meant to be run from the mplroot directory."""
-import os, sys, glob, shutil
+import os, shutil
roots = ['test_matplotlib','test_plots']
savedresults_dir = 'saved-results'
@@ -80,7 +80,6 @@
# new matplotlib.testing infrastructure
- os.chdir('test')
for fname in get_recursive_filelist(['result_images']):
# only images
if not fname.endswith('.png'): continue
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|