diff --git a/.gitignore b/.gitignore
index 43c7c5ef6bda..a9c493de9cb7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
-# Editor temporary/working/backup files #
#########################################
+# Editor temporary/working/backup files #
.#*
[#]*#
*~
@@ -27,6 +27,8 @@ doc/_build
dist
# Egg metadata
*.egg-info
+# tox testing tool
+.tox
# OS generated files #
######################
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000000..08b835a3a850
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,17 @@
+language: python
+
+python:
+ - 2.6
+ - 2.7
+ - 3.1
+ - 3.2
+
+install:
+ - pip install --use-mirrors nose numpy
+ - if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip install --use-mirrors PIL; fi
+ - python setup.py install
+
+script:
+ - mkdir ../foo
+ - cd ../foo
+ - python ../matplotlib/tests.py
diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst
index 87c15a68f492..eaed93f84ddb 100644
--- a/doc/devel/coding_guide.rst
+++ b/doc/devel/coding_guide.rst
@@ -509,6 +509,72 @@ Let's say you've added a new module named
the list of default tests, append its name to ``default_test_modules``
in :file:`lib/matplotlib/__init__.py`.
+Using tox
+---------
+
+`Tox `_ is a tool for running tests against multiple
+Python environments, including multiple versions of Python (e.g.: 2.6, 2.7,
+3.2, etc.) and even different Python implementations altogether (e.g.: CPython,
+PyPy, Jython, etc.)
+
+Testing all 4 versions of Python (2.6, 2.7, 3.1, and 3.2) requires having four
+versions of Python installed on your system and on the PATH. Depending on your
+operating system, you may want to use your package manager (such as apt-get,
+yum or MacPorts) to do this, or use `pythonbrew
+`_.
+
+tox makes it easy to determine if your working copy introduced any regressions
+before submitting a pull request. Here's how to use it:
+
+.. code-block:: bash
+
+ $ pip install tox
+ $ tox
+
+You can also run tox on a subset of environments:
+
+.. code-block:: bash
+
+ $ tox -e py26,py27
+
+Tox processes everything serially so it can take a long time to test several
+environments. To speed it up, you might try using a new, parallelized version
+of tox called ``detox``. Give this a try:
+
+.. code-block:: bash
+
+ $ pip install -U -i http://pypi.testrun.org detox
+ $ detox
+
+Tox is configured using a file called ``tox.ini``. You may need to edit this
+file if you want to add new environments to test (e.g.: ``py33``) or if you
+want to tweak the dependencies or the way the tests are run. For more info on
+the ``tox.ini`` file, see the `Tox Configuration Specification
+`_.
+
+Using Travis CI
+---------------
+
+`Travis CI `_ is a hosted CI system "in the cloud".
+
+Travis is configured to receive notifications of new commits to GitHub repos
+(via GitHub "service hooks") and to run builds or tests when it sees these new
+commits. It looks for a YAML file called ``.travis.yml`` in the root of the
+repository to see how to test the project.
+
+Travis CI is already enabled for the `main matplotlib GitHub repository
+`_ -- for example, see `its Travis
+page `_.
+
+If you want to enable Travis CI for your personal matplotlib GitHub repo,
+simply enable the repo to use Travis CI in either the Travis CI UI or the
+GitHub UI (Admin | Service Hooks). For details, see `the Travis CI Getting
+Started page `_.
+
+Once this is configured, you can see the Travis CI results at
+http://travis-ci.org/#!/your_GitHub_user_name/matplotlib -- here's `an example
+`_.
+
.. _license-discussion:
Licenses
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000000000000..f6bca134b12d
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,16 @@
+# Tox (http://tox.testrun.org/) is a tool for running tests
+# in multiple virtualenvs. This configuration file will run the
+# test suite on all supported python versions. To use it, "pip install tox"
+# and then run "tox" from this directory.
+
+[tox]
+envlist = py26, py27, py31, py32
+
+[testenv]
+changedir = /tmp
+commands =
+ sh -c 'rm -f $HOME/.matplotlib/fontList*'
+ {envpython} {toxinidir}/tests.py
+deps =
+ nose
+ numpy