Fix documentation
This commit is contained in:
1 parent
a317c07124
commit
ab21b3f30d
27 files changed
+2137
-1043
No files matched your search
@@ -1,4 +1,6 @@
|
||||
/* Exercises source/HotReload end to end against the real PluginV1/
|
||||
/**
|
||||
* @file Main.cpp
|
||||
* @brief Automated test suite: exercises source/HotReload end to end against the real PluginV1/
|
||||
* PluginV2 builds from source/examples/HotReloadDemo -- see
|
||||
* ../../examples/HotReloadDemo/Shared/PluginApi.h and CppWidgetApi.h
|
||||
* for what each exported name is there to prove. Deliberately does
|
||||
@@ -22,8 +24,14 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
/// Running count of failed CHECK() calls; main() returns non-zero when this is non-zero.
|
||||
int g_failures = 0;
|
||||
|
||||
/// Records a failed check to stderr and increments g_failures. Called only through CHECK().
|
||||
/// @param condition The check's result.
|
||||
/// @param expression The checked expression, stringified.
|
||||
/// @param file The source file the check appears in.
|
||||
/// @param line The line the check appears on.
|
||||
void checkImpl(bool condition, const char* expression, const char* file, int line)
|
||||
{
|
||||
if (!condition)
|
||||
@@ -33,12 +41,18 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks @p expr and records a failure (with its source location) if it is false, without
|
||||
/// relying on assert(), which NDEBUG (this project's default Release build) compiles out.
|
||||
#define CHECK(expr) checkImpl((expr), #expr, __FILE__, __LINE__)
|
||||
|
||||
/// The signature every plain-C export in PluginApi.h shares.
|
||||
using PluginFunction = int (*)(int);
|
||||
|
||||
/// Every symbol event seen so far in the current reload, keyed by symbol name.
|
||||
std::map<std::string, HotReloadSymbolEvent> g_events;
|
||||
|
||||
/// Records each event into g_events for later CHECK()s to inspect.
|
||||
/// @param event Describes one symbol's outcome.
|
||||
void onSymbolEvent(const HotReloadSymbolEventInfo* event, void* /*userData*/)
|
||||
{
|
||||
g_events[event->name] = event->kind;
|
||||
@@ -46,6 +60,8 @@ namespace
|
||||
|
||||
}
|
||||
|
||||
/// Runs every check described in this file's @ref Main.cpp "file comment".
|
||||
/// @return 0 if every CHECK() passed, 1 otherwise.
|
||||
int main()
|
||||
{
|
||||
HotReloadOptions options{};
|
||||
|
||||
Reference in new issue
Block a user