diff --git a/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py b/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py index 49229880b88f836bccf2ebc82a1aed919900c5f6..1421ddf27f117ef879b864d8d3ec5ab4fb2cd9cd 100644 --- a/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py +++ b/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py @@ -150,7 +150,10 @@ def test_BG_to_DB(tc,io,cmd): tc.append_log(3, '') tc.append_log(1, '>>> (BG==DB): %s' % compared) 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) Bg.write_disable() @@ -212,11 +215,14 @@ def test_info(tc,io,cmd): expected_design_name = tc.gpString if expected_design_name != '': 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: if (name != expected_design_name): 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(1, '>>> Verify design_name == %s: %s' % (expected_design_name,compared)) @@ -282,7 +288,7 @@ def test_remu(tc,io,cmd): tc.append_log(1, '>>> %s' % help_text(tc,io,cmd)) 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') Remu = pi_remu.PiRemu(dummy_tc, io) @@ -413,32 +419,21 @@ signal.signal(signal.SIGINT, signal_handler) ################################################################################################################## # Run tests -nof_errors = 0 run = 0 while tc.repeat != 0: # -1 for non-stop tc.repeat -= 1 run += 1 tc.append_log(3, '') - tc.append_log(2, 'Run = %d' % run) try: for cmd in tc.sequence: - tc.append_log(3, 'Next command: %s' % cmd) - - - subtc = test_case.Testcase('TB %d (%.02fs) - ' % (run,tc.get_run_time()), '') - subtc.set_result('PASSED') + tc.set_section_id('Next command: %s ' % cmd) + tc.append_log(1, '>>> Testrun %d (@%.02fs) - ' % (run,tc.get_run_time())) if cmd == 'REGMAP': # reload node_io: - io = Cmd[cmd][0](subtc,io,cmd) + io = Cmd[cmd][0](tc,io,cmd) else: - Cmd[cmd][0](subtc,io,cmd) - - if subtc.get_result() == 'FAILED': - nof_errors+=1 - tc.append_log(3, 'Testcase FAILED') - tc.append_log(3, '>>>') - tc.set_result('FAILED') + Cmd[cmd][0](tc,io,cmd) except KeyError: @@ -457,7 +452,7 @@ tc.append_log(3, '') tc.append_log(3, '>>>') 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 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(3, '>>>')