added debug output for tests, corrected bug reporting number of successful tests
This commit is contained in:
parent
9b679c3c0b
commit
e87296b10a
|
@ -23,19 +23,8 @@ class Test():
|
||||||
if len(variants) == 0: variants = xrange(len(self.variants)) # iterate over all variants
|
if len(variants) == 0: variants = xrange(len(self.variants)) # iterate over all variants
|
||||||
|
|
||||||
self.clean()
|
self.clean()
|
||||||
# for variant in variants:
|
|
||||||
# try:
|
|
||||||
# self.prepare(variant)
|
|
||||||
# self.run(variant)
|
|
||||||
# self.postprocess(variant)
|
|
||||||
# if variant in update:
|
|
||||||
# self.update(variant)
|
|
||||||
# elif not self.compare(variant):
|
|
||||||
# return variant
|
|
||||||
# except:
|
|
||||||
# return variant
|
|
||||||
# return -1
|
|
||||||
for variant in variants:
|
for variant in variants:
|
||||||
|
try:
|
||||||
self.prepare(variant)
|
self.prepare(variant)
|
||||||
self.run(variant)
|
self.run(variant)
|
||||||
self.postprocess(variant)
|
self.postprocess(variant)
|
||||||
|
@ -43,7 +32,18 @@ class Test():
|
||||||
self.update(variant)
|
self.update(variant)
|
||||||
elif not self.compare(variant):
|
elif not self.compare(variant):
|
||||||
return variant
|
return variant
|
||||||
|
except:
|
||||||
|
return variant
|
||||||
return -1
|
return -1
|
||||||
|
# for variant in variants:
|
||||||
|
# self.prepare(variant)
|
||||||
|
# self.run(variant)
|
||||||
|
# self.postprocess(variant)
|
||||||
|
# if variant in update:
|
||||||
|
# self.update(variant)
|
||||||
|
# elif not self.compare(variant):
|
||||||
|
# return variant
|
||||||
|
# return -1
|
||||||
|
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
@ -152,9 +152,9 @@ class Test():
|
||||||
print 'maximum relative error',max_err
|
print 'maximum relative error',max_err
|
||||||
return max_err
|
return max_err
|
||||||
|
|
||||||
def reportSuccess(self,culprit):
|
def report_Success(self,culprit):
|
||||||
if culprit < 0:
|
if culprit < 0:
|
||||||
print '%s passed.'%({False: 'The test',
|
print '%s passed.'%({False: 'The test',
|
||||||
True: 'All %i tests'%(len(theTest.variants))}[len(theTest.variants) > 1])
|
True: 'All %i tests'%(len(self.variants))}[len(self.variants) > 1])
|
||||||
else:
|
else:
|
||||||
print 'Test %i failed...'%(culprit+1)
|
print 'Test %i failed...'%(culprit+1)
|
||||||
|
|
Loading…
Reference in New Issue