Commit a1ea8034 authored by Aurel's avatar Aurel

display all results for listbox's performances before doing assertion


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24775 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5de4c594
...@@ -211,9 +211,9 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -211,9 +211,9 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
if PROFILE: if PROFILE:
self.profile(self.bar_module.BarModule_viewBarList) self.profile(self.bar_module.BarModule_viewBarList)
# check result
keys = view_result.keys() keys = view_result.keys()
keys.sort() keys.sort()
# first display results
i = 0 i = 0
for key in keys: for key in keys:
module_value = view_result[key] module_value = view_result[key]
...@@ -225,19 +225,28 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor): ...@@ -225,19 +225,28 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
print "nb objects = %s\n\tadd = %.4f < %.4f < %.4f" %(key, MIN_OBJECT_CREATION, add_value, MAX_OBJECT_CREATION) print "nb objects = %s\n\tadd = %.4f < %.4f < %.4f" %(key, MIN_OBJECT_CREATION, add_value, MAX_OBJECT_CREATION)
print "\ttic = %.4f < %.4f < %.4f" %(MIN_TIC, tic_value, MAX_TIC) print "\ttic = %.4f < %.4f < %.4f" %(MIN_TIC, tic_value, MAX_TIC)
print "\tview = %.4f < %.4f < %.4f" %(min_view, module_value, max_view) print "\tview = %.4f < %.4f < %.4f" %(min_view, module_value, max_view)
print print
if DO_TEST: i += 1
# then check results
if DO_TEST:
i = 0
for key in keys:
module_value = view_result[key]
tic_value = tic_result[key]
add_value = add_result[key]
min_view = MIN_MODULE_VIEW + LISTBOX_COEF * i
max_view = MAX_MODULE_VIEW + LISTBOX_COEF * i
self.failUnless(min_view < module_value < max_view, self.failUnless(min_view < module_value < max_view,
'View: %.4f < %.4f < %.4f' % ( 'View: %.4f < %.4f < %.4f' % (
min_view, module_value, max_view)) min_view, module_value, max_view))
self.failUnless( self.failUnless(
MIN_OBJECT_CREATION < add_value < MAX_OBJECT_CREATION, MIN_OBJECT_CREATION < add_value < MAX_OBJECT_CREATION,
'Create: %.4f < %.4f < %.4f' % ( 'Create: %.4f < %.4f < %.4f' % (
MIN_OBJECT_CREATION, add_value, MAX_OBJECT_CREATION)) MIN_OBJECT_CREATION, add_value, MAX_OBJECT_CREATION))
self.failUnless(MIN_TIC < tic_value < MAX_TIC, self.failUnless(MIN_TIC < tic_value < MAX_TIC,
'Tic: %.4f < %.4f < %.4f' % ( 'Tic: %.4f < %.4f < %.4f' % (
MIN_TIC, tic_value, MAX_TIC)) MIN_TIC, tic_value, MAX_TIC))
i += 1 i += 1
def test_viewProxyField(self, quiet=quiet): def test_viewProxyField(self, quiet=quiet):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment