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 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_ */