unit-test-app: fix test script error when handling multiple unit test configs in one config file:
If we have multiple configs, we need to flash DUT with different binaries. But if we don't close DUT before apply new config, the old DUT will be reused, so new config name will not be applied.
This commit is contained in:
parent
1c65f1aed3
commit
9665c6ef66
1 changed files with 8 additions and 0 deletions
|
@ -306,6 +306,8 @@ def run_unit_test_cases(env, extra_data):
|
||||||
finally:
|
finally:
|
||||||
TinyFW.JunitReport.update_performance(performance_items)
|
TinyFW.JunitReport.update_performance(performance_items)
|
||||||
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
||||||
|
# close DUT when finish running all cases for one config
|
||||||
|
env.close_dut(dut.name)
|
||||||
|
|
||||||
# raise exception if any case fails
|
# raise exception if any case fails
|
||||||
if failed_cases:
|
if failed_cases:
|
||||||
|
@ -507,6 +509,10 @@ def run_multiple_devices_cases(env, extra_data):
|
||||||
failed_cases.append(one_case["name"])
|
failed_cases.append(one_case["name"])
|
||||||
Utility.console_log("Failed: " + one_case["name"], color="red")
|
Utility.console_log("Failed: " + one_case["name"], color="red")
|
||||||
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
||||||
|
# close all DUTs when finish running all cases for one config
|
||||||
|
for dut in duts:
|
||||||
|
env.close_dut(dut)
|
||||||
|
duts = {}
|
||||||
|
|
||||||
if failed_cases:
|
if failed_cases:
|
||||||
Utility.console_log("Failed Cases:", color="red")
|
Utility.console_log("Failed Cases:", color="red")
|
||||||
|
@ -658,6 +664,8 @@ def run_multiple_stage_cases(env, extra_data):
|
||||||
finally:
|
finally:
|
||||||
TinyFW.JunitReport.update_performance(performance_items)
|
TinyFW.JunitReport.update_performance(performance_items)
|
||||||
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
TinyFW.JunitReport.test_case_finish(junit_test_case)
|
||||||
|
# close DUT when finish running all cases for one config
|
||||||
|
env.close_dut(dut.name)
|
||||||
|
|
||||||
# raise exception if any case fails
|
# raise exception if any case fails
|
||||||
if failed_cases:
|
if failed_cases:
|
||||||
|
|
Loading…
Reference in a new issue