Skip to content
Snippets Groups Projects
Commit e0c62ce5 authored by Kenneth Hiemstra's avatar Kenneth Hiemstra
Browse files

fix test_case and test_log issues

parent e0a2572b
Branches
No related tags found
No related merge requests found
...@@ -150,7 +150,10 @@ def test_BG_to_DB(tc,io,cmd): ...@@ -150,7 +150,10 @@ def test_BG_to_DB(tc,io,cmd):
tc.append_log(3, '') tc.append_log(3, '')
tc.append_log(1, '>>> (BG==DB): %s' % compared) tc.append_log(1, '>>> (BG==DB): %s' % compared)
tc.append_log(3, '') tc.append_log(3, '')
if compared==False: tc.set_result('FAILED') if compared==False:
tc.set_result('FAILED')
tc.append_log(1,'FAILED')
show_compare_arrays(tc,bg_ram,db_ram) show_compare_arrays(tc,bg_ram,db_ram)
Bg.write_disable() Bg.write_disable()
...@@ -212,11 +215,14 @@ def test_info(tc,io,cmd): ...@@ -212,11 +215,14 @@ def test_info(tc,io,cmd):
expected_design_name = tc.gpString expected_design_name = tc.gpString
if expected_design_name != '': if expected_design_name != '':
tc.set_section_id('Verify System Info - ') tc.set_section_id('Verify System Info - ')
tc.append_log(1, '>>> Verifying design_name == %s' % expected_design_name) compared=True
for name in design_name: for name in design_name:
if (name != expected_design_name): if (name != expected_design_name):
tc.set_result('FAILED') tc.set_result('FAILED')
tc.append_log(1,'FAILED')
compared=False
tc.append_log(2, '>>> design_name mismatch!! (%s != %s)' % (name,expected_design_name)) tc.append_log(2, '>>> design_name mismatch!! (%s != %s)' % (name,expected_design_name))
tc.append_log(1, '>>> Verify design_name == %s: %s' % (expected_design_name,compared))
...@@ -282,7 +288,7 @@ def test_remu(tc,io,cmd): ...@@ -282,7 +288,7 @@ def test_remu(tc,io,cmd):
tc.append_log(1, '>>> %s' % help_text(tc,io,cmd)) tc.append_log(1, '>>> %s' % help_text(tc,io,cmd))
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
dummy_tc = test_case.Testcase('Dummy TB - ', '') dummy_tc = test_case.Testcase('Dummy TB - ', '',logfilename='REMU-log')
dummy_tc.set_result('PASSED') dummy_tc.set_result('PASSED')
Remu = pi_remu.PiRemu(dummy_tc, io) Remu = pi_remu.PiRemu(dummy_tc, io)
...@@ -413,32 +419,21 @@ signal.signal(signal.SIGINT, signal_handler) ...@@ -413,32 +419,21 @@ signal.signal(signal.SIGINT, signal_handler)
################################################################################################################## ##################################################################################################################
# Run tests # Run tests
nof_errors = 0
run = 0 run = 0
while tc.repeat != 0: # -1 for non-stop while tc.repeat != 0: # -1 for non-stop
tc.repeat -= 1 tc.repeat -= 1
run += 1 run += 1
tc.append_log(3, '') tc.append_log(3, '')
tc.append_log(2, 'Run = %d' % run)
try: try:
for cmd in tc.sequence: for cmd in tc.sequence:
tc.append_log(3, 'Next command: %s' % cmd) tc.set_section_id('Next command: %s ' % cmd)
tc.append_log(1, '>>> Testrun %d (@%.02fs) - ' % (run,tc.get_run_time()))
subtc = test_case.Testcase('TB %d (%.02fs) - ' % (run,tc.get_run_time()), '')
subtc.set_result('PASSED')
if cmd == 'REGMAP': # reload node_io: if cmd == 'REGMAP': # reload node_io:
io = Cmd[cmd][0](subtc,io,cmd) io = Cmd[cmd][0](tc,io,cmd)
else: else:
Cmd[cmd][0](subtc,io,cmd) Cmd[cmd][0](tc,io,cmd)
if subtc.get_result() == 'FAILED':
nof_errors+=1
tc.append_log(3, 'Testcase FAILED')
tc.append_log(3, '>>>')
tc.set_result('FAILED')
except KeyError: except KeyError:
...@@ -457,7 +452,7 @@ tc.append_log(3, '') ...@@ -457,7 +452,7 @@ tc.append_log(3, '')
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
tc.append_log(0, '>>> Test bench result: %s' % tc.get_result()) tc.append_log(0, '>>> Test bench result: %s' % tc.get_result())
tc.append_log(0, '>>> Number of runs=%d' % run) tc.append_log(0, '>>> Number of runs=%d' % run)
tc.append_log(0, '>>> Number of errors=%d' % nof_errors) tc.append_log(0, '>>> Number of errors=%d' % tc.get_nof_errors())
tc.append_log(0, '>>> Runtime=%f seconds (%f hours)' % (tc.get_run_time(),tc.get_run_time()/3600)) tc.append_log(0, '>>> Runtime=%f seconds (%f hours)' % (tc.get_run_time(),tc.get_run_time()/3600))
tc.append_log(3, '>>>') tc.append_log(3, '>>>')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment