[coverage] exclude logging code from coverage report (#3947)

This commit is contained in:
Jonathan Hui
2019-07-02 00:18:02 +02:00
committed by GitHub
parent ce26bffb50
commit af46ffa53b
12 changed files with 57 additions and 6 deletions
+4
View File
@@ -170,6 +170,8 @@ exit:
return;
}
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_CORE == 1)
void Notifier::LogChangedFlags(otChangedFlags aFlags) const
@@ -335,4 +337,6 @@ const char *Notifier::FlagToString(otChangedFlags) const
#endif // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_CORE == 1)
// LCOV_EXCL_STOP
} // namespace ot
+4
View File
@@ -45,6 +45,8 @@
namespace ot {
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_UTIL != 0)
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO)
@@ -88,6 +90,8 @@ void SettingsBase::LogFailure(otError error, const char *aText, bool aIsDelete)
#endif // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_WARN)
#endif // #if (OPENTHREAD_CONFIG_LOG_UTIL != 0)
// LCOV_EXCL_STOP
void Settings::Init(void)
{
otPlatSettingsInit(&GetInstance());
+6
View File
@@ -206,7 +206,10 @@ void LinkRaw::InvokeEnergyScanDone(int8_t aEnergyScanMaxRssi)
}
}
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
void LinkRaw::RecordFrameTransmitStatus(const Frame &aFrame,
const Frame *aAckFrame,
otError aError,
@@ -222,8 +225,11 @@ void LinkRaw::RecordFrameTransmitStatus(const Frame &aFrame,
aFrame.GetMaxFrameRetries(), aFrame.ToInfoString().AsCString());
}
}
#endif
// LCOV_EXCL_STOP
} // namespace Mac
} // namespace ot
+6 -2
View File
@@ -1835,6 +1835,10 @@ int8_t Mac::GetNoiseFloor(void)
return otPlatRadioGetReceiveSensitivity(&GetInstance());
}
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
const char *Mac::OperationToString(Operation aOperation)
{
const char *retval = "";
@@ -1877,8 +1881,6 @@ const char *Mac::OperationToString(Operation aOperation)
return retval;
}
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
void Mac::LogFrameRxFailure(const Frame *aFrame, otError aError) const
{
otLogLevel logLevel;
@@ -1934,6 +1936,8 @@ void Mac::LogFrameTxFailure(const Frame &, otError, uint8_t) const
#endif // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
// LCOV_EXCL_STOP
#if OPENTHREAD_CONFIG_ENABLE_TIME_SYNC
void Mac::ProcessTimeIe(Frame &aFrame)
{
+8
View File
@@ -1058,6 +1058,10 @@ uint16_t Frame::GetFcsSize(void) const
return kFcsSize;
}
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
Frame::InfoString Frame::ToInfoString(void) const
{
InfoString string;
@@ -1132,5 +1136,9 @@ BeaconPayload::InfoString BeaconPayload::ToInfoString(void) const
IsNative() ? "yes" : "no");
}
#endif // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
// LCOV_EXCL_STOP
} // namespace Mac
} // namespace ot
+4
View File
@@ -574,6 +574,8 @@ void SubMac::SetState(State aState)
}
}
// LCOV_EXCL_START
const char *SubMac::StateToString(State aState)
{
const char *str = "Unknown";
@@ -603,6 +605,8 @@ const char *SubMac::StateToString(State aState)
return str;
}
// LCOV_EXCL_STOP
//---------------------------------------------------------------------------------------------------------------------
// otPlatRadio callbacks
+4
View File
@@ -637,6 +637,8 @@ void Joiner::HandleTimer(void)
Finish(error);
}
// LOCV_EXCL_START
const char *Joiner::JoinerStateToString(otJoinerState aState)
{
const char *str = "Unknown";
@@ -681,6 +683,8 @@ exit:
}
#endif
// LCOV_EXCL_STOP
} // namespace MeshCoP
} // namespace ot
+4
View File
@@ -1080,6 +1080,8 @@ exit:
return rval;
}
// LCOV_EXCL_START
const char *Ip6::IpProtoToString(IpProto aIpProto)
{
const char *retval;
@@ -1130,5 +1132,7 @@ const char *Ip6::IpProtoToString(IpProto aIpProto)
return retval;
}
// LCOV_EXCL_STOP
} // namespace Ip6
} // namespace ot
+6 -2
View File
@@ -1549,6 +1549,8 @@ exit:
return error;
}
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
otError MeshForwarder::ParseIp6UdpTcpHeader(const Message &aMessage,
@@ -1802,7 +1804,7 @@ void MeshForwarder::LogLowpanHcFrameDrop(otError aError,
aIsSecure ? "yes" : "no");
}
#else // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
#else // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
void MeshForwarder::LogMessage(MessageAction, const Message &, const Mac::Address *, otError)
{
@@ -1825,6 +1827,8 @@ void MeshForwarder::LogLowpanHcFrameDrop(otError, uint16_t, const Mac::Address &
{
}
#endif // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
#endif // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
// LCOV_EXCL_STOP
} // namespace ot
+4
View File
@@ -1228,6 +1228,8 @@ exit:
}
#endif // OPENTHREAD_ENABLE_SERVICE
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
otError MeshForwarder::LogMeshFragmentHeader(MessageAction aAction,
@@ -1408,6 +1410,8 @@ exit:
#endif // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
// LCOV_EXCL_STOP
} // namespace ot
#endif // OPENTHREAD_FTD
+5
View File
@@ -4190,7 +4190,10 @@ const char *Mle::RoleToString(otDeviceRole aRole)
return roleString;
}
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MLE == 1)
const char *Mle::AttachModeToString(AttachMode aMode)
{
const char *str = "unknown";
@@ -4287,6 +4290,8 @@ const char *Mle::ReattachStateToString(ReattachState aState)
#endif // (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_NOTE) && (OPENTHREAD_CONFIG_LOG_MLE == 1)
// LCOV_EXCL_STOP
void Mle::RegisterParentResponseStatsCallback(otThreadParentResponseCallback aCallback, void *aContext)
{
mParentResponseCb = aCallback;
+2 -2
View File
@@ -1114,7 +1114,7 @@ spinel_ssize_t spinel_datatype_vpack(uint8_t * data_out,
// ----------------------------------------------------------------------------
// MARK: -
// **** LCOV_EXCL_START ****
// LCOV_EXCL_START
const char *spinel_command_to_cstr(unsigned int command)
{
@@ -2619,7 +2619,7 @@ const char *spinel_capability_to_cstr(unsigned int capability)
return ret;
}
// **** LCOV_EXCL_STOP ****
// LCOV_EXCL_STOP
/* -------------------------------------------------------------------------- */