Add Antithesis intrumentation (#5042)

* Copy Antithesis SDK version 0.4.0 to directory external/
* Add build option `voidstar` to enable instrumentation with Antithesis SDK
* Define instrumentation macros ASSERT and UNREACHABLE in terms of regular C assert
* Replace asserts with named ASSERT or UNREACHABLE
* Add UNREACHABLE to LogicError
* Document instrumentation macros in CONTRIBUTING.md
This commit is contained in:
Bronek Kozicki
2024-12-03 14:52:21 -05:00
committed by Ed Hennis
parent f64cf9187a
commit d7e949193f
261 changed files with 3827 additions and 1034 deletions

View File

@@ -20,8 +20,8 @@
#include <xrpl/basics/Log.h>
#include <xrpl/basics/chrono.h>
#include <xrpl/basics/contract.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <boost/algorithm/string.hpp>
#include <cassert>
#include <fstream>
#include <functional>
#include <iostream>
@@ -224,7 +224,7 @@ Logs::fromSeverity(beast::severities::Severity level)
return lsERROR;
default:
assert(false);
UNREACHABLE("ripple::Logs::fromSeverity : invalid severity");
[[fallthrough]];
case kFatal:
break;
@@ -250,7 +250,7 @@ Logs::toSeverity(LogSeverity level)
case lsERROR:
return kError;
default:
assert(false);
UNREACHABLE("ripple::Logs::toSeverity : invalid severity");
[[fallthrough]];
case lsFATAL:
break;
@@ -277,7 +277,7 @@ Logs::toString(LogSeverity s)
case lsFATAL:
return "Fatal";
default:
assert(false);
UNREACHABLE("ripple::Logs::toString : invalid severity");
return "Unknown";
}
}
@@ -341,7 +341,7 @@ Logs::format(
output += "ERR ";
break;
default:
assert(false);
UNREACHABLE("ripple::Logs::format : invalid severity");
[[fallthrough]];
case kFatal:
output += "FTL ";