From 78d23a9d902c4d521ddeb998b9f1689660d061b8 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 29 Oct 2024 09:52:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20(tests):=20Functional/System=20-?= =?UTF-8?q?=20erase=20flash=20at=20the=20end?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/run_functional_tests.py | 3 +++ tools/run_system_tests.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/run_functional_tests.py b/tools/run_functional_tests.py index 15345a4da4..4d488a9d7f 100755 --- a/tools/run_functional_tests.py +++ b/tools/run_functional_tests.py @@ -352,6 +352,9 @@ def main(): if fails: ret = 1 + print("Erasing flash after tests...") + flash_erase() + return ret diff --git a/tools/run_system_tests.py b/tools/run_system_tests.py index 8ecc132e30..75d94e8bce 100755 --- a/tools/run_system_tests.py +++ b/tools/run_system_tests.py @@ -237,6 +237,7 @@ def parse_line(line): def main(): + ret = 0 connect_serial() if FLASH_ERASE_FLAG: @@ -257,10 +258,15 @@ def main(): if deep_sleep >= DEEP_SLEEP_PERCENTAGE: print(Fore.GREEN + f"Deep sleep is higher than {DEEP_SLEEP_PERCENTAGE}%, this is good! ✅" + Style.RESET_ALL) - return 0 + ret = 0 else: print(Fore.RED + f"Deep sleep is lower than {DEEP_SLEEP_PERCENTAGE}%, this is bad! ❌" + Style.RESET_ALL) - return 1 + ret = 1 + + print("Erasing flash after tests...") + erase_flash() + + return ret if __name__ == '__main__':