diff options
author | Jeremy Bettis <jbettis@google.com> | 2023-01-04 13:19:21 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-01-10 01:14:46 +0000 |
commit | d33741859e6f66023045e46810a95a1add06d7ae (patch) | |
tree | 7cf6672459579e37c9f5b76323c2032c81bf369b /firmware_builder.py | |
parent | 83870209314421d0114f868f8f4a92578310e87d (diff) | |
download | chrome-ec-d33741859e6f66023045e46810a95a1add06d7ae.tar.gz |
cq: Clean host dir before building with ASAN
Since adding TEST_ASAN=y doesn't change the output directory, it will
reuse existing .obj files that were not built with ASAN.
Delete build/host before running tests with ASAN.
Add -u option to python3 command to flush all print statements
immediately.
BRANCH=None
BUG=b:257393779
TEST=cq dry run
Change-Id: Ie0b636d49cc9382793b0a0d62111b13dadb34928
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4136960
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'firmware_builder.py')
-rwxr-xr-x | firmware_builder.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware_builder.py b/firmware_builder.py index 8e0b8ef749..3b075a019a 100755 --- a/firmware_builder.py +++ b/firmware_builder.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env -S python3 -u # -*- coding: utf-8 -*- # Copyright 2020 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be @@ -13,6 +13,7 @@ import argparse import multiprocessing import os import pathlib +import shutil import subprocess import sys @@ -303,6 +304,12 @@ def test(opts): subprocess.run(cmd, cwd=os.path.dirname(__file__), check=True) # Verify the tests pass with ASan also + ec_dir = os.path.dirname(__file__) + build_dir = os.path.join(ec_dir, "build") + host_dir = os.path.join(build_dir, "host") + print(f"# Deleting {host_dir}") + shutil.rmtree(host_dir) + cmd = ["make", "TEST_ASAN=y", target, f"-j{opts.cpus}"] print(f"# Running {' '.join(cmd)}.") subprocess.run(cmd, cwd=os.path.dirname(__file__), check=True) |