00001 """
00002
00003 This is the Runner Class. It should inherit from the PresidenceStack to allow for operators.
00004 Unless this is not in the given task.
00005
00006 """
00007
00008 __copyright__ = """
00009 Copyright 2008 Sean Ross-Ross
00010 """
00011 __license__ = """
00012 This file is part of SLIMpy .
00013
00014 SLIMpy is free software: you can redistribute it and/or modify
00015 it under the terms of the GNU Lesser General Public License as published by
00016 the Free Software Foundation, either version 3 of the License, or
00017 (at your option) any later version.
00018
00019 SLIMpy is distributed in the hope that it will be useful,
00020 but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00022 GNU Lesser General Public License for more details.
00023
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>.
00026 """
00027
00028
00029 from slimpy_base.Core.Runners.RunnerBase import Runner
00030 from slimpy_base.utils.DotTest import DotTester
00031 from unittest import TextTestRunner
00032 from sys import stdout
00033
00034
00035 class dottestRunner( Runner ):
00036 """
00037 runs a dot-test on all currently defined linear operators
00038 does not run script
00039 """
00040 type = "dottest"
00041
00042 def __init__( self ,places=3):
00043 self.places = places
00044
00045 def set_graph(self, graph):
00046 pass
00047
00048 def run( self ):
00049 """
00050 run the current graph with targets
00051 """
00052
00053 del self.env['graphmgr']
00054
00055 tester = DotTester( )
00056
00057 print 'running dot-tests:'
00058 print str( tester )
00059 print '-building test suite'
00060
00061 suite = tester.buildTestSuite( places=self.places )
00062 print '-running test suite'
00063 testRunner = TextTestRunner( stdout, 1, 1 )
00064 tester.clear( )
00065
00066
00067
00068 from slimpy_base.Core.Runners.defaultRunner import defaultRunner as runner
00069 self.env['graphmgr'].setRunner( runner() )
00070
00071 return testRunner.run( suite )
00072