diff --git a/libavutil/adler32.c b/libavutil/adler32.c
index 9d3d8965063b95f2baf24be134be317dd8a64b9e..8ea5fc29582e452ebaa8e452646f0587fead1e7b 100644
--- a/libavutil/adler32.c
+++ b/libavutil/adler32.c
@@ -56,6 +56,7 @@ unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf,
 }
 
 #ifdef TEST
+// LCOV_EXCL_START
 #include <string.h>
 #include "log.h"
 #include "timer.h"
@@ -84,4 +85,5 @@ int main(int argc, char **argv)
     av_log(NULL, AV_LOG_DEBUG, "%X (expected 50E6E508)\n", checksum);
     return checksum == 0x50e6e508 ? 0 : 1;
 }
+// LCOV_EXCL_STOP
 #endif
diff --git a/libavutil/aes.c b/libavutil/aes.c
index af552618643190a89c9514f13b76cec78fd4dda7..46b290ccc45ad2f43ae4fa9f00ae419447b4d16b 100644
--- a/libavutil/aes.c
+++ b/libavutil/aes.c
@@ -259,6 +259,7 @@ int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt)
 }
 
 #ifdef TEST
+// LCOV_EXCL_START
 #include <string.h>
 #include "lfg.h"
 #include "log.h"
@@ -331,4 +332,5 @@ int main(int argc, char **argv)
     }
     return err;
 }
+// LCOV_EXCL_STOP
 #endif
diff --git a/libavutil/base64.c b/libavutil/base64.c
index 1b70fa9f33abe7799e358d503aaee79988f34c85..4ccc12e76ebfc512d4adcc0420996b42f1a3cc42 100644
--- a/libavutil/base64.c
+++ b/libavutil/base64.c
@@ -100,6 +100,7 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size)
 }
 
 #ifdef TEST
+// LCOV_EXCL_START
 
 #undef printf
 
@@ -161,4 +162,5 @@ int main(void)
     return error_count;
 }
 
+// LCOV_EXCL_STOP
 #endif
diff --git a/libavutil/des.c b/libavutil/des.c
index b876dccd53dae65918abb6eeb496d7ffbd05ca47..e1c0ebcbfb65b4bd6549ad29a9eaebac608a28f5 100644
--- a/libavutil/des.c
+++ b/libavutil/des.c
@@ -337,6 +337,7 @@ void av_des_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count) {
 }
 
 #ifdef TEST
+// LCOV_EXCL_START
 #undef printf
 #undef rand
 #undef srand
@@ -443,4 +444,5 @@ int main(void) {
 #endif
     return 0;
 }
+// LCOV_EXCL_STOP
 #endif
diff --git a/libavutil/eval.c b/libavutil/eval.c
index 3a8b60d5052d4fe0926c7ffafe89de02670bb68d..1b8176c505a67b88efccef0acc8208da6f7703c0 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -579,6 +579,7 @@ int av_expr_parse_and_eval(double *d, const char *s,
 }
 
 #if FF_API_OLD_EVAL_NAMES
+// LCOV_EXCL_START
 int av_parse_expr(AVExpr **expr, const char *s,
                   const char * const *const_names,
                   const char * const *func1_names, double (* const *funcs1)(void *, double),
@@ -608,9 +609,11 @@ void av_free_expr(AVExpr *e)
 {
     av_expr_free(e);
 }
+// LCOV_EXCL_STOP
 #endif /* FF_API_OLD_EVAL_NAMES */
 
 #ifdef TEST
+// LCOV_EXCL_START
 #undef printf
 #include <string.h>
 
@@ -723,4 +726,5 @@ int main(int argc, char **argv)
 
     return 0;
 }
+// LCOV_EXCL_STOP
 #endif