unit_test: Print the timeout value when an 'expect' times out
This commit is contained in:
parent
50aad77f3a
commit
d35debcd99
1 changed files with 7 additions and 5 deletions
|
@ -231,14 +231,15 @@ def run_one_normal_case(dut, one_case, junit_test_case):
|
||||||
|
|
||||||
while not test_finish:
|
while not test_finish:
|
||||||
try:
|
try:
|
||||||
|
timeout_value = one_case["timeout"]
|
||||||
dut.expect_any((RESET_PATTERN, handle_exception_reset),
|
dut.expect_any((RESET_PATTERN, handle_exception_reset),
|
||||||
(EXCEPTION_PATTERN, handle_exception_reset),
|
(EXCEPTION_PATTERN, handle_exception_reset),
|
||||||
(ABORT_PATTERN, handle_exception_reset),
|
(ABORT_PATTERN, handle_exception_reset),
|
||||||
(FINISH_PATTERN, handle_test_finish),
|
(FINISH_PATTERN, handle_test_finish),
|
||||||
(UT_APP_BOOT_UP_DONE, handle_reset_finish),
|
(UT_APP_BOOT_UP_DONE, handle_reset_finish),
|
||||||
timeout=one_case["timeout"])
|
timeout=timeout_value)
|
||||||
except DUT.ExpectTimeout:
|
except DUT.ExpectTimeout:
|
||||||
Utility.console_log("Timeout in expect", color="orange")
|
Utility.console_log("Timeout in expect (%s seconds)" % timeout_value, color="orange")
|
||||||
junit_test_case.add_failure_info("timeout")
|
junit_test_case.add_failure_info("timeout")
|
||||||
one_case_finish(False)
|
one_case_finish(False)
|
||||||
break
|
break
|
||||||
|
@ -394,7 +395,7 @@ class Handler(threading.Thread):
|
||||||
(self.FINISH_PATTERN, handle_device_test_finish), # test finish pattern
|
(self.FINISH_PATTERN, handle_device_test_finish), # test finish pattern
|
||||||
timeout=self.timeout)
|
timeout=self.timeout)
|
||||||
except DUT.ExpectTimeout:
|
except DUT.ExpectTimeout:
|
||||||
Utility.console_log("Timeout in expect", color="orange")
|
Utility.console_log("Timeout in expect (%s seconds)" % self.timeout, color="orange")
|
||||||
one_device_case_finish(False)
|
one_device_case_finish(False)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -594,14 +595,15 @@ def run_one_multiple_stage_case(dut, one_case, junit_test_case):
|
||||||
|
|
||||||
while not stage_finish:
|
while not stage_finish:
|
||||||
try:
|
try:
|
||||||
|
timeout_value = one_case["timeout"]
|
||||||
dut.expect_any((RESET_PATTERN, handle_exception_reset),
|
dut.expect_any((RESET_PATTERN, handle_exception_reset),
|
||||||
(EXCEPTION_PATTERN, handle_exception_reset),
|
(EXCEPTION_PATTERN, handle_exception_reset),
|
||||||
(ABORT_PATTERN, handle_exception_reset),
|
(ABORT_PATTERN, handle_exception_reset),
|
||||||
(FINISH_PATTERN, handle_test_finish),
|
(FINISH_PATTERN, handle_test_finish),
|
||||||
(UT_APP_BOOT_UP_DONE, handle_next_stage),
|
(UT_APP_BOOT_UP_DONE, handle_next_stage),
|
||||||
timeout=one_case["timeout"])
|
timeout=timeout_value)
|
||||||
except DUT.ExpectTimeout:
|
except DUT.ExpectTimeout:
|
||||||
Utility.console_log("Timeout in expect", color="orange")
|
Utility.console_log("Timeout in expect (%s seconds)" % timeout_value, color="orange")
|
||||||
one_case_finish(False)
|
one_case_finish(False)
|
||||||
break
|
break
|
||||||
if stage_finish[0] == "break":
|
if stage_finish[0] == "break":
|
||||||
|
|
Loading…
Reference in a new issue