From 69c0e6243e51ba430bd8c22fe0e85650fd087f1f Mon Sep 17 00:00:00 2001 From: He Yin Ling Date: Fri, 22 Nov 2019 11:41:57 +0800 Subject: [PATCH] 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. --- tools/unit-test-app/unit_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/unit-test-app/unit_test.py b/tools/unit-test-app/unit_test.py index 586c439d7..b30cead1a 100755 --- a/tools/unit-test-app/unit_test.py +++ b/tools/unit-test-app/unit_test.py @@ -310,6 +310,8 @@ def run_unit_test_cases(env, extra_data): finally: TinyFW.JunitReport.update_performance(performance_items) 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 if failed_cases: @@ -511,6 +513,10 @@ def run_multiple_devices_cases(env, extra_data): failed_cases.append(format_case_name(one_case)) Utility.console_log("Failed: " + format_case_name(one_case), color="red") 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: Utility.console_log("Failed Cases:", color="red") @@ -662,6 +668,8 @@ def run_multiple_stage_cases(env, extra_data): finally: TinyFW.JunitReport.update_performance(performance_items) 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 if failed_cases: