From 8c38ef726b8d00a40fc71106376e84b41ff4be00 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 26 Aug 2025 15:04:27 -0400 Subject: [PATCH] chore: exclude a bunch of code that doesn't need to be tested from codecov (#5721) * exclude the bulk of HostFunc.h from codecov * fix codecov (maybe) * adjust * more codecov excl --- src/xrpld/app/wasm/HostFunc.h | 2 ++ src/xrpld/app/wasm/detail/WamrVM.cpp | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/xrpld/app/wasm/HostFunc.h b/src/xrpld/app/wasm/HostFunc.h index 08058e45c5..56ce33e69d 100644 --- a/src/xrpld/app/wasm/HostFunc.h +++ b/src/xrpld/app/wasm/HostFunc.h @@ -99,6 +99,7 @@ floatLogImpl(Slice const& x, int32_t mode); struct HostFunctions { + // LCOV_EXCL_START virtual void setRT(void const*) { @@ -519,6 +520,7 @@ struct HostFunctions } virtual ~HostFunctions() = default; + // LCOV_EXCL_STOP }; } // namespace ripple diff --git a/src/xrpld/app/wasm/detail/WamrVM.cpp b/src/xrpld/app/wasm/detail/WamrVM.cpp index 413240559b..e47a618f12 100644 --- a/src/xrpld/app/wasm/detail/WamrVM.cpp +++ b/src/xrpld/app/wasm/detail/WamrVM.cpp @@ -35,6 +35,7 @@ namespace ripple { namespace { +// LCOV_EXCL_START static log_level_t getLogLevel(beast::severities::Severity severity) { @@ -155,6 +156,7 @@ print_wasm_error(std::string_view msg, wasm_trap_t* trap, beast::Journal jlog) j << std::endl; #endif } +// LCOV_EXCL_STOP } // namespace @@ -525,14 +527,20 @@ ModuleWrapper::buildImports( imp.udata, nullptr); if (!func) + { + // LCOV_EXCL_START throw std::runtime_error( - "can't create import function " + - imp.name); // LCOV_EXCL_LINE + "can't create import function " + imp.name); + // LCOV_EXCL_STOP + } if (imp.gas && !wasm_func_set_gas(func, imp.gas)) + { + // LCOV_EXCL_START throw std::runtime_error( - "can't set gas for import function " + - imp.name); // LCOV_EXCL_LINE + "can't set gas for import function " + imp.name); + // LCOV_EXCL_STOP + } wimports.data[i] = wasm_func_as_extern(func); ++impCnt;