summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-10-13 14:21:55 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-14 20:04:27 +0000
commit7325b164157eaf3dfd5af35bb115f229cb4a2c29 (patch)
tree5e4cc9240b62c0cace286e7260d31170ebca81ed
parente2aa8ef9165d7f65b65d81ea1412891bfae5db41 (diff)
downloadchrome-ec-7325b164157eaf3dfd5af35bb115f229cb4a2c29.tar.gz
cq: Expand coverage exclusions
There were some test files that were not getting excluded by the test filter. Most importantly, some tests are mixed into the same directories, but named _test.c. BRANCH=None BUG=None TEST=./firmware_builder.py --code-coverage test lcov --list-full-path --list build/zephyr/lcov_no_tests.info | \ sed -e 's|/mnt/host/source/src/||' | egrep 'mock|emul|test|host' Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I4d8335c4185ba373f93fbfe6bf2ed99aaa7a0ba0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3957418 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Yuval Peress <peress@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
-rw-r--r--.gitlab-ci.yml48
-rwxr-xr-xzephyr/firmware_builder.py21
2 files changed, 62 insertions, 7 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 83f5df5eec..fd31410ca0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -166,10 +166,28 @@ before_script:
"${EC_DIR}/zephyr/drivers/**" "${EC_DIR}/zephyr/include/drivers/**"
"${EC_DIR}/zephyr/shim/chip/**" "${EC_DIR}/zephyr/shim/core/**"
"${EC_DIR}/zephyr/projects/**" "/usr/include/x86_64-linux-gnu/**"
- "${EC_DIR}/build/*/build-*/zephyr/*/generated/**" "${EC_DIR}/test/**"
+ "${EC_DIR}/build/*/build-*/zephyr/*/generated/**"
"${EC_DIR}/zephyr/shim/chip/npcx/npcx_monitor/**"
- "${EC_DIR}/zephyr/emul/**" "${EC_DIR}/zephyr/test/**"
- "**/testsuite/**" "**/subsys/emul/**"
+ "${EC_DIR}/test/**"
+ "${EC_DIR}/include/tests/**"
+ "${EC_DIR}/private/test/**"
+ "${EC_DIR}/private/fingerprint/google-fpalg/mcutest/**"
+ "${EC_DIR}/zephyr/test/**"
+ "${EC_DIR}/include/mock/**"
+ "${EC_DIR}/common/mock/**"
+ "${EC_DIR}/board/host/**"
+ "${EC_DIR}/chip/host/**"
+ "${EC_DIR}/core/host/**"
+ "${EC_DIR}/zephyr/emul/**"
+ "${EC_DIR}/zephyr/mock/**"
+ "**/*_test.c"
+ "**/*_test.h"
+ "**/*_emul.c"
+ "**/*_emul.h"
+ "${EC_DIR}/include/test_util.h"
+ "${EC_DIR}/common/test_util.c"
+ "${EC_DIR}/zephyr/shim/src/test_util.c"
+ "${EC_DIR}/zephyr/shim/src/ztest_system.c"
- /usr/bin/genhtml --branch-coverage -q
-o "${BUILD_DIR}/${PROJECT}/output/filtered_no_zephyr_rpt"
-t "${PROJECT} coverage w/o zephyr"
@@ -321,10 +339,28 @@ merged_coverage:
"${EC_DIR}/zephyr/drivers/**" "${EC_DIR}/zephyr/include/drivers/**"
"${EC_DIR}/zephyr/shim/chip/**" "${EC_DIR}/zephyr/shim/core/**"
"${EC_DIR}/zephyr/projects/**" "/usr/include/x86_64-linux-gnu/**"
- "${EC_DIR}/build/*/build-*/zephyr/*/generated/**" "${EC_DIR}/test/**"
+ "${EC_DIR}/build/*/build-*/zephyr/*/generated/**"
"${EC_DIR}/zephyr/shim/chip/npcx/npcx_monitor/**"
- "${EC_DIR}/zephyr/emul/**" "${EC_DIR}/zephyr/test/**"
- "**/testsuite/**" "**/subsys/emul/**"
+ "${EC_DIR}/test/**"
+ "${EC_DIR}/include/tests/**"
+ "${EC_DIR}/private/test/**"
+ "${EC_DIR}/private/fingerprint/google-fpalg/mcutest/**"
+ "${EC_DIR}/zephyr/test/**"
+ "${EC_DIR}/include/mock/**"
+ "${EC_DIR}/common/mock/**"
+ "${EC_DIR}/board/host/**"
+ "${EC_DIR}/chip/host/**"
+ "${EC_DIR}/core/host/**"
+ "${EC_DIR}/zephyr/emul/**"
+ "${EC_DIR}/zephyr/mock/**"
+ "**/*_test.c"
+ "**/*_test.h"
+ "**/*_emul.c"
+ "**/*_emul.h"
+ "${EC_DIR}/include/test_util.h"
+ "${EC_DIR}/common/test_util.c"
+ "${EC_DIR}/zephyr/shim/src/test_util.c"
+ "${EC_DIR}/zephyr/shim/src/ztest_system.c"
- grep -h "SF:" ${BUILD_DIR}/zephyr/all_builds[0-9]*.info | sort -u |
sed -e 's|^SF:||' | xargs lcov --rc lcov_branch_coverage=1
-o "${BUILD_DIR}/all_builds_filtered.info"
diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py
index 6081c774fa..1e46603faa 100755
--- a/zephyr/firmware_builder.py
+++ b/zephyr/firmware_builder.py
@@ -346,13 +346,32 @@ def test(opts):
)
test_patterns = [
+ # Exclude tests
platform_ec / "test/**",
+ platform_ec / "include/tests/**",
+ platform_ec / "private/test/**",
platform_ec / "private/fingerprint/google-fpalg/mcutest/**",
zephyr_dir / "test/**",
+ third_party / "zephyr/main/subsys/testsuite/**",
+ # Exclude mocks & emulators
+ platform_ec / "include/mock/**",
+ platform_ec / "common/mock/**",
+ platform_ec / "board/host/**",
+ platform_ec / "chip/host/**",
+ platform_ec / "core/host/**",
zephyr_dir / "emul/**",
zephyr_dir / "mock/**",
third_party / "zephyr/main/subsys/emul/**",
- third_party / "zephyr/main/subsys/testsuite/**",
+ # Exclude all files ending in _test.[ch] or _emul.[ch]
+ "**/*_test.c",
+ "**/*_test.h",
+ "**/*_emul.c",
+ "**/*_emul.h",
+ # Exclude some special cases that don't match the other patterns
+ platform_ec / "include/test_util.h",
+ platform_ec / "common/test_util.c",
+ zephyr_dir / "shim/src/test_util.c",
+ zephyr_dir / "shim/src/ztest_system.c",
]
generated_and_system_patterns = [