Package qm :: Package test :: Package classes :: Module simulator
[hide private]
[frames] | no frames]

Source Code for Module qm.test.classes.simulator

 1  ######################################################################## 
 2  # 
 3  # File:   simulator.py 
 4  # Author: Mark Mitchell 
 5  # Date:   2005-06-03 
 6  # 
 7  # Contents: 
 8  #   Simulator 
 9  # 
10  # Copyright (c) 2005 by CodeSourcery, LLC.  All rights reserved.  
11  # 
12  ######################################################################## 
13   
14  ######################################################################## 
15  # Imports 
16  ####################################################################### 
17   
18  from local_host import LocalHost 
19  from qm.fields import TextField, SetField 
20   
21  ######################################################################## 
22  # Classes 
23  ####################################################################### 
24   
25 -class Simulator(LocalHost):
26 """A 'Simulator' is a semi-hosted simulation environment. 27 28 The local file system is shared with the simulated machine. A 29 simulator is used to execute programs.""" 30 31 simulator = TextField( 32 description = """The simulation program.""" 33 ) 34 35 # Any arguments that must be provided to the simulator. 36 simulator_args = SetField( 37 TextField(description = """Arguments to the simulation program.""")) 38
39 - def Run(self, path, arguments, environment = None, timeout = -1):
40 41 arguments = self.simulator_args + [path] + arguments 42 return super(Simulator, self.Run(self.simulator, 43 arguments, 44 environment, 45 timeout))
46