Public Member Functions | Public Attributes | List of all members
runtests.TestManager Class Reference

Public Member Functions

def __init__ (self, args, tests)
 
def ok (self, result, test_name, msg='Ok')
 
def result (self)
 
def perform_tests (self)
 

Public Attributes

 args
 
 tests
 
 num_tests
 
 count
 
 passed
 

Detailed Description

Definition at line 134 of file runtests.py.

Constructor & Destructor Documentation

def runtests.TestManager.__init__ (   self,
  args,
  tests 
)

Definition at line 135 of file runtests.py.

135  def __init__(self,args,tests):
136  self.args = args
137  self.tests = tests
138  self.num_tests = len(tests)
139  self.count=1
140  self.passed=0
141  print('1..%d' % self.num_tests)
142 
def __init__(self, args, tests)
Definition: runtests.py:135

Member Function Documentation

def runtests.TestManager.ok (   self,
  result,
  test_name,
  msg = 'Ok' 
)

Definition at line 143 of file runtests.py.

143  def ok(self,result,test_name,msg='Ok'):
144  if result:
145  print('ok %s - %s' % (self.count,test_name))
146  self.passed = self.passed + 1
147  else:
148  print('not ok %s - %s' % (self.count,test_name))
149  print('-------------------------------------')
150  print(msg)
151  print('-------------------------------------')
152  self.count = self.count + 1
153 
def ok(self, result, test_name, msg='Ok')
Definition: runtests.py:143
def runtests.TestManager.perform_tests (   self)

Definition at line 161 of file runtests.py.

161  def perform_tests(self):
162  for test in self.tests:
163  tester = Tester(self.args,test)
164  tester.run(self)
165  return 0 if self.args.updateref else self.result()
166 
def perform_tests(self)
Definition: runtests.py:161
def result(self)
Definition: runtests.py:154
def runtests.TestManager.result (   self)

Definition at line 154 of file runtests.py.

154  def result(self):
155  if self.passed==self.num_tests:
156  print('All tests passed!')
157  else:
158  print('%d out of %s tests failed' % (self.num_tests-self.passed,self.num_tests))
159  return 0 if self.passed==self.num_tests else 1
160 
def result(self)
Definition: runtests.py:154

Member Data Documentation

runtests.TestManager.args

Definition at line 136 of file runtests.py.

runtests.TestManager.count

Definition at line 139 of file runtests.py.

runtests.TestManager.num_tests

Definition at line 138 of file runtests.py.

runtests.TestManager.passed

Definition at line 140 of file runtests.py.

runtests.TestManager.tests

Definition at line 137 of file runtests.py.


The documentation for this class was generated from the following file: