Exclude some files from coverage 07/297307/1
authorMichal Bloch <m.bloch@samsung.com>
Wed, 16 Aug 2023 19:08:45 +0000 (21:08 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Wed, 16 Aug 2023 19:24:57 +0000 (21:24 +0200)
Change-Id: I4c546d8e3479b7498c9ed2def85b7f710672b012

src/libdlog/log_zero_copy.c
src/libdlogutil/fdi_zero_copy.c
src/shared/backend_androidlogger.c
src/shared/buffer_config.c
src/shared/translate_syslog.c

index 06ff17b..8af8268 100644 (file)
@@ -37,6 +37,9 @@
 #include <logcommon.h>
 #include <zero_copy_backend.h>
 
+// Coverage measuring environment does not have the zlogger backend, exclude it
+//LCOV_EXCL_START
+
 static int g_fd = 0;
 _Thread_local volatile void *g_shm_ptr = 0;
 _Thread_local uint64_t last_ts = 0;
@@ -154,3 +157,5 @@ int __dlog_init_zero_copy(const struct log_config *config)
 
        return 0;
 }
+
+//LCOV_EXCL_STOP
index db82ddf..374a202 100644 (file)
@@ -37,6 +37,9 @@
 #include "fd_info.h"
 #include "fdi_zero_copy.h"
 
+// Coverage test environment doesn't have zlogger backend, exclude it from measurements
+//LCOV_EXCL_START
+
 static const uint64_t ZLOGGER_MONITOR_INTERVAL = 1 * NSEC_PER_SEC;
 
 static int zero_copy_get_capacity(struct fd_info *fdi, unsigned int *capacity)
@@ -377,6 +380,8 @@ static bool zero_copy_has_log(struct fd_info *fdi)
        return zpd->items != NULL;
 }
 
+//LCOV_EXCL_STOP
+
 const struct fd_ops ops_zero_copy = {
        .create        = zero_copy_create,
        .destroy       = zero_copy_destroy,
index 1eba03d..56fbf0e 100644 (file)
@@ -69,10 +69,13 @@ static int logger_set_protocol_version(int fd)
         * but because v1 doesn't actually support the SET_VERSION call.
         * DLog doesn't actually support version 1 devices but it's
         * good to have feedback on which version is in place. */
+
+       //LCOV_EXCL_START
        if (errno == EINVAL)
                return 1;
 
        return -errno;
+       //LCOV_EXCL_STOP
 }
 
 /*
index 4886ee5..2fcbb17 100644 (file)
@@ -37,7 +37,7 @@ bool is_buffer_enabled(log_id_t id, const struct log_config *conf)
        char key[MAX_CONF_KEY_LEN];
        const int r = snprintf(key, sizeof key, "enable_%s", log_name_by_id(id));
        if (r < 0)
-               return plog_default;
+               return plog_default; //LCOV_EXCL_LINE
 
        return log_config_get_boolean(conf, key, plog_default);
 }
index 15d4f2c..fb9d284 100644 (file)
@@ -28,6 +28,9 @@
 
 #include "translate_syslog.h"
 
+// Syslog isn't currently supported
+//LCOV_EXCL_START
+
 /**
  * @addtogroup SHARED_FUNCTIONS
  * @{
@@ -120,3 +123,5 @@ const char *translate_syslog_facility(int fac_prio)
 /**
  * @}
  */
+
+//LCOV_EXCL_STOP