From 76545bd70a0cbd423b641ced0cfa42feea64fb3e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 27 Jul 2026 12:21:50 -0400 Subject: [PATCH 1/2] test: move some unit test infra to be more global This moves the definition for STATIC so that it's always defined as nothing for SHIM_UNIT_TEST and as "static" for everything else. In doing so, it adds a header "shim-unit-test.h" which is at the very end of shim.h . Signed-off-by: Peter Jones --- include/shim-unit-test.h | 19 +++++++++++++++++++ shim.h | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 include/shim-unit-test.h diff --git a/include/shim-unit-test.h b/include/shim-unit-test.h new file mode 100644 index 000000000..bd3e6ec60 --- /dev/null +++ b/include/shim-unit-test.h @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: BSD-2-Clause-Patent +/* + * shim-unit-test.h - setup that always needs done on unit tests + * Copyright Peter Jones + */ + +#pragma once + +#ifdef SHIM_UNIT_TEST + +# define STATIC + +#else /* !SHIM_UNIT_TEST */ + +# define STATIC static + +#endif /* SHIM_UNIT_TEST */ + +// vim:fenc=utf-8:tw=75:noet diff --git a/shim.h b/shim.h index d3d6aa32a..837a1ba57 100644 --- a/shim.h +++ b/shim.h @@ -336,6 +336,13 @@ char *translate_slashes(char *out, const char *str); #include +/* + * gnu-efi leaks a STATIC define, remove it. + */ +#ifdef STATIC +#undef STATIC +#endif + typedef struct { EFI_LOADED_IMAGE li; EFI_IMAGE_ENTRY_POINT entry_point; @@ -350,4 +357,6 @@ typedef struct { EFI_DEVICE_PATH *loaded_image_device_path; } SHIM_LOADED_IMAGE; +#include "shim-unit-test.h" + #endif /* SHIM_H_ */ From 1f66299f15c4124302ebcb2070ee6d9278c0369f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Jul 2026 09:40:34 -0400 Subject: [PATCH 2/2] Add a .codecov.yml Signed-off-by: Peter Jones --- .codecov.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 000000000..0f055f53d --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,25 @@ +codecov: + notify: + wait_for_ci: true + require_ci_to_pass: true + branch: main +comment: + behavior: default + layout: reach,diff,flags,tree,reach + show_carryforward_flags: false +coverage: + precision: 2 + range: + - 60.0 + - 80.0 + round: down + status: + changes: false + default_rules: + flag_coverage_not_uploaded_behavior: include + patch: true + project: + default: + threshold: 5 + target: auto +slack_app: true