http://hg.viff.dk/viff/rev/ef0499add96c changeset: 1193:ef0499add96c user: Martin Geisler <m...@cs.au.dk> date: Wed Jun 24 11:21:20 2009 +0200 summary: Make the VIFF reactor available to trial.
diffstat: 4 files changed, 33 insertions(+), 7 deletions(-) .hgignore | 1 + doc/unit-testing.txt | 13 ++++++++++--- twisted/plugins/viff_reactor.py | 21 +++++++++++++++++++++ viff/test/__init__.py | 5 +---- diffs (83 lines): diff -r c1259ceebc55 -r ef0499add96c .hgignore --- a/.hgignore Fri Jun 19 09:05:00 2009 +0200 +++ b/.hgignore Wed Jun 24 11:21:20 2009 +0200 @@ -18,6 +18,7 @@ # Trial output directory. _trial_temp +dropin.cache # Benchmarking data. profile.data diff -r c1259ceebc55 -r ef0499add96c doc/unit-testing.txt --- a/doc/unit-testing.txt Fri Jun 19 09:05:00 2009 +0200 +++ b/doc/unit-testing.txt Wed Jun 24 11:21:20 2009 +0200 @@ -45,10 +45,10 @@ If it fails with an ImportError, then please double-check that your ``PYTHONPATH`` is setup correctly. -Now simply execute ``trial viff`` to run the unit tests. You should -get output similar to this:: +Now simply execute ``trial --reactor viff viff`` to run the unit +tests. You should get output similar to this:: - % trial viff + % trial --reactor viff viff Seeding random generator with random seed 4658 Running 65 tests. viff.test.test_active_runtime @@ -149,6 +149,13 @@ would be cluttered with long of traceback messages, making it difficult to notice new *unexpected* failures. +.. warning:: + + Always run ``trial`` with the ``--reactor viff`` arguments. This + ensures that the tests are run with the special VIFF reactor. The + tests currently cannot be run without this reactor, but we might + lift this restriction in the future. + Writing Unit Tests ------------------ diff -r c1259ceebc55 -r ef0499add96c twisted/plugins/viff_reactor.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/twisted/plugins/viff_reactor.py Wed Jun 24 11:21:20 2009 +0200 @@ -0,0 +1,21 @@ +# Copyright 2009 VIFF Development Team. +# +# This file is part of VIFF, the Virtual Ideal Functionality Framework. +# +# VIFF is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License (LGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# VIFF is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with VIFF. If not, see <http://www.gnu.org/licenses/>. + +# This will register the VIFF reactor so that "trial --reactor viff" +# can install it. +from twisted.application.reactors import Reactor +viff = Reactor('viff', 'viff.reactor', 'The re-entrent VIFF reactor.') diff -r c1259ceebc55 -r ef0499add96c viff/test/__init__.py --- a/viff/test/__init__.py Fri Jun 19 09:05:00 2009 +0200 +++ b/viff/test/__init__.py Wed Jun 24 11:21:20 2009 +0200 @@ -1,4 +1,4 @@ -# Copyright 2007, 2008 VIFF Development Team. +# Copyright 2007, 2008, 2009 VIFF Development Team. # # This file is part of VIFF, the Virtual Ideal Functionality Framework. # @@ -14,6 +14,3 @@ # # You should have received a copy of the GNU Lesser General Public # License along with VIFF. If not, see <http://www.gnu.org/licenses/>. - -import viff.reactor -viff.reactor.install() _______________________________________________ viff-commits mailing list viff-commits@viff.dk http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk