Restructure into umbrella modules (~55 -> 16 targets)
Headers move, CMake targets merge, C++ namespaces stay unchanged: - Core: Scope, Lazy, Counted, Flags, Hash, Bits, Uuid, TypeList, TypeMap, Variant - Functional: Pipeline, Either, Result, Retry - Containers: Ring, Pool, PriorityQueue, LRU, Trie, Graph, DisjointSet, Bitset, Interval - Math: +Matrix, Numeric, Random, Histogram - Text: Str, Format, Tokenizer, Diff, Encoding, Semver - Data: Json, Csv, Ini - Async: Coro, Concurrency, EventBus, Observable - Time: +Bench - Log: Log facade + Logging framework (facade now header-only, breaking the Stacktrace<->Log link cycle the merge would have created) - System: FileSystem + Process - Configuration: +Argparse - Unchanged: Stacktrace, Plugin, StateMachine, Testing, TestingMock, Detail Module system fixes: - OPTIONAL_DEPS resolution deferred to void_finalize_modules() so it no longer depends on the alphabetical discovery order of src/ subdirs (Testing -> Text would have been silently dropped). - Every header-only module now has a tracked module.cmake; previously the empty src/<Name> marker dirs were untracked, so a fresh clone would have silently skipped those modules. - VOID_HAS_LOGGING/CONCURRENCY/STR consumers renamed to LOG/ASYNC/TEXT. Tests move to tests/standalone/<Umbrella>/<Feature>.cpp (Result suite files prefixed: ResultBasic etc.). Test count verified identical (831) before and after. README/CLAUDE.md module tables updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
da2e93c405
commit
28b94883fd
156 files changed
+278
-220
No files matched your search
@@ -0,0 +1 @@
|
||||
void_add_module(Async)
|
||||
@@ -1,3 +0,0 @@
|
||||
void_add_module(Concurrency
|
||||
INTERNAL_DEPS Log
|
||||
)
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <Void/Argparse/Argparse.hpp>
|
||||
#include <Void/Configuration/Argparse.hpp>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
void_add_module(Configuration
|
||||
INTERNAL_DEPS Result FileSystem Log
|
||||
INTERNAL_DEPS Functional System
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(Containers)
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(Core)
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(Data)
|
||||
@@ -1,3 +0,0 @@
|
||||
void_add_module(FileSystem
|
||||
INTERNAL_DEPS Result Log
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(Functional)
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <Void/Detail/Enum.hpp>
|
||||
#include <Void/Logging/ConsoleLogger.hpp>
|
||||
#include <Void/Log/ConsoleLogger.hpp>
|
||||
|
||||
#ifdef VOID_HAS_STACKTRACE
|
||||
#include <Void/Stacktrace/Color.hpp>
|
||||
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
#include <Void/Logging/FileLogger.hpp>
|
||||
#include <Void/Log/FileLogger.hpp>
|
||||
#include <Void/Log/Log.hpp>
|
||||
|
||||
#include <format>
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <Void/Logging/Level.hpp>
|
||||
#include <Void/Log/Level.hpp>
|
||||
#include <string_view>
|
||||
namespace Void::Logging
|
||||
{
|
||||
@@ -1,28 +0,0 @@
|
||||
#include <Void/Log/Log.hpp>
|
||||
#include <mutex>
|
||||
#include <shared_mutex>
|
||||
|
||||
namespace Void::Log
|
||||
{
|
||||
|
||||
namespace
|
||||
{
|
||||
Sink g_sink;
|
||||
std::shared_mutex g_mutex;
|
||||
} // namespace
|
||||
|
||||
void set_sink(Sink sink)
|
||||
{
|
||||
std::unique_lock lock{g_mutex};
|
||||
g_sink = std::move(sink);
|
||||
}
|
||||
|
||||
void log(Level level, std::string_view module, std::string_view message)
|
||||
{
|
||||
std::shared_lock lock{g_mutex};
|
||||
if (g_sink) {
|
||||
g_sink(level, module, message);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Void::Log
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <Void/Logging/Logger.hpp>
|
||||
#include <Void/Log/Logger.hpp>
|
||||
|
||||
#include <utility> // std::exchange
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
void_add_module(Log)
|
||||
void_add_module(Log
|
||||
INTERNAL_DEPS Functional
|
||||
OPTIONAL_DEPS Stacktrace
|
||||
)
|
||||
@@ -1,4 +0,0 @@
|
||||
void_add_module(Logging
|
||||
INTERNAL_DEPS Result Log
|
||||
OPTIONAL_DEPS Stacktrace
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(Math)
|
||||
@@ -1,3 +0,0 @@
|
||||
void_add_module(Process
|
||||
INTERNAL_DEPS Result Log
|
||||
)
|
||||
@@ -1 +0,0 @@
|
||||
void_add_module(Result)
|
||||
@@ -1,5 +1,5 @@
|
||||
void_add_module(Stacktrace
|
||||
INTERNAL_DEPS Result Log
|
||||
INTERNAL_DEPS Functional
|
||||
EXTERNAL_DEPS Boost::stacktrace_backtrace
|
||||
DEPS_WIN32 dbghelp
|
||||
DEPS_UNIX dl
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(StateMachine)
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <Void/Process/Process.hpp>
|
||||
#include <Void/System/Process.hpp>
|
||||
#include <Void/Log/Log.hpp>
|
||||
|
||||
#include <format>
|
||||
@@ -0,0 +1,3 @@
|
||||
void_add_module(System
|
||||
INTERNAL_DEPS Functional
|
||||
)
|
||||
+23
-23
@@ -14,8 +14,8 @@
|
||||
#include <Void/Testing/JUnitReporter.hpp>
|
||||
#include <Void/Time/Format.hpp>
|
||||
|
||||
#ifdef VOID_HAS_CONCURRENCY
|
||||
#include <Void/Concurrency/ThreadPool.hpp>
|
||||
#ifdef VOID_HAS_ASYNC
|
||||
#include <Void/Async/ThreadPool.hpp>
|
||||
#include <future>
|
||||
#endif
|
||||
|
||||
@@ -25,15 +25,15 @@
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
#include <Void/Log/LoggingAdapter.hpp>
|
||||
#include <Void/Logging/ConsoleLogger.hpp>
|
||||
#include <Void/Logging/FileLogger.hpp>
|
||||
#include <Void/Logging/Level.hpp>
|
||||
#include <Void/Log/ConsoleLogger.hpp>
|
||||
#include <Void/Log/FileLogger.hpp>
|
||||
#include <Void/Log/Level.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef VOID_HAS_STR
|
||||
#include <Void/Str/Str.hpp>
|
||||
#ifdef VOID_HAS_TEXT
|
||||
#include <Void/Text/Str.hpp>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
@@ -345,7 +345,7 @@ namespace Void::Testing
|
||||
|
||||
constexpr std::size_t OPT_WIDTH = 23;
|
||||
auto opt = [&](std::string_view name) {
|
||||
#ifdef VOID_HAS_STR
|
||||
#ifdef VOID_HAS_TEXT
|
||||
return apply(green, Void::Str::pad_right(name, OPT_WIDTH));
|
||||
#else
|
||||
std::string s{name};
|
||||
@@ -377,13 +377,13 @@ namespace Void::Testing
|
||||
<< "\n"
|
||||
<< " " << opt("--output <file>")
|
||||
<< apply(dim, "Write reporter output to a file") << "\n"
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
<< " " << opt("--log-file <file>")
|
||||
<< apply(dim,
|
||||
"Mirror test events to <file> via Void::Logging")
|
||||
<< "\n"
|
||||
#endif
|
||||
#ifdef VOID_HAS_CONCURRENCY
|
||||
#ifdef VOID_HAS_ASYNC
|
||||
<< " " << opt("--parallel <n>")
|
||||
<< apply(dim,
|
||||
"Run tests across n threads (no crash detection)")
|
||||
@@ -414,7 +414,7 @@ namespace Void::Testing
|
||||
auto reporter = create_reporter(config);
|
||||
|
||||
// ── Optional: file logger sink (requires Void::Logging) ──────────────────
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
std::unique_ptr<Void::Logging::FileLogger> log_sink;
|
||||
if (!config.log_file.empty()) {
|
||||
try {
|
||||
@@ -433,7 +433,7 @@ namespace Void::Testing
|
||||
#endif
|
||||
|
||||
// ── Optional: VOID_LOG_LEVEL auto-sink ───────────────────────────────────
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
std::unique_ptr<Void::Logging::ConsoleLogger> env_log;
|
||||
{
|
||||
#ifdef VOID_HAS_CONFIGURATION
|
||||
@@ -463,7 +463,7 @@ namespace Void::Testing
|
||||
Void::Log::set_sink(Void::Log::make_sink(*env_log));
|
||||
}
|
||||
}
|
||||
#endif // VOID_HAS_LOGGING
|
||||
#endif // VOID_HAS_LOG
|
||||
|
||||
if (config.list_only) {
|
||||
for (const auto& t : tests) {
|
||||
@@ -485,7 +485,7 @@ namespace Void::Testing
|
||||
}
|
||||
|
||||
auto log_result = [&](const TestResult& r, const std::string& q) {
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
if (!log_sink) {
|
||||
return;
|
||||
}
|
||||
@@ -523,7 +523,7 @@ namespace Void::Testing
|
||||
|
||||
// ── Optional: parallel execution (requires Void::Concurrency) ────────────
|
||||
bool run_parallel = config.parallel_threads > 0;
|
||||
#ifndef VOID_HAS_CONCURRENCY
|
||||
#ifndef VOID_HAS_ASYNC
|
||||
if (run_parallel) {
|
||||
std::cerr << "warning: --parallel requires Void::Concurrency "
|
||||
"(not linked); running sequentially\n";
|
||||
@@ -532,9 +532,9 @@ namespace Void::Testing
|
||||
#endif
|
||||
|
||||
if (run_parallel) {
|
||||
#ifdef VOID_HAS_CONCURRENCY
|
||||
#ifdef VOID_HAS_ASYNC
|
||||
reporter->on_run_start(config, static_cast<int>(tests.size()));
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
if (log_sink) {
|
||||
log_sink->info(std::format(
|
||||
"run start (parallel, {} threads): {} test(s)",
|
||||
@@ -575,10 +575,10 @@ namespace Void::Testing
|
||||
suite_results[suite_index[test.suite]].tests.push_back(
|
||||
std::move(result));
|
||||
}
|
||||
#endif // VOID_HAS_CONCURRENCY
|
||||
#endif // VOID_HAS_ASYNC
|
||||
} else {
|
||||
reporter->on_run_start(config, static_cast<int>(tests.size()));
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
if (log_sink) {
|
||||
log_sink->info(std::format("run start: {} test(s) discovered",
|
||||
tests.size()));
|
||||
@@ -587,7 +587,7 @@ namespace Void::Testing
|
||||
if (config.shuffle) {
|
||||
std::shuffle(tests.begin(), tests.end(),
|
||||
std::mt19937{config.random_seed});
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
if (log_sink) {
|
||||
log_sink->info(std::format("shuffle enabled (seed = {})",
|
||||
config.random_seed));
|
||||
@@ -609,7 +609,7 @@ namespace Void::Testing
|
||||
[&](const auto& t) {
|
||||
return t.suite == suite.name;
|
||||
}));
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
if (log_sink) {
|
||||
log_sink->info(std::format("suite start: {}",
|
||||
suite.name));
|
||||
@@ -653,7 +653,7 @@ namespace Void::Testing
|
||||
}
|
||||
run_result.total_duration = end_time - start_time;
|
||||
reporter->on_run_end(run_result);
|
||||
#ifdef VOID_HAS_LOGGING
|
||||
#ifdef VOID_HAS_LOG
|
||||
if (log_sink) {
|
||||
log_sink->info(
|
||||
std::format("run end: {} total / {} passed / {} failed / {} "
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
void_add_module(Testing
|
||||
OPTIONAL_DEPS Stacktrace Logging Concurrency Configuration Str
|
||||
OPTIONAL_DEPS Stacktrace Log Async Configuration Text
|
||||
)
|
||||
@@ -1 +1 @@
|
||||
void_add_module(TestingMock INTERNAL_DEPS Testing Result)
|
||||
void_add_module(TestingMock INTERNAL_DEPS Testing Functional)
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(Text)
|
||||
@@ -0,0 +1 @@
|
||||
void_add_module(Time)
|
||||
Reference in new issue
Block a user