feat: migration breadth, project templates, preset export, IDE/registry polish
VoidBuildSystem CI / 1 · Requirements (push) Successful in 3s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 2m11s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m33s
VoidBuildSystem CI / 2A · Linux build (coverage) (push) Successful in 2m44s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 4m16s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m37s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m29s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 24s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m52s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 20s
VoidBuildSystem CI / 3A · Linux test (coverage) (push) Failing after 1m57s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Successful in 6m47s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Successful in 7m4s
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Skipped
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Skipped
VoidBuildSystem CI / 5 · Release (push) Skipped

- vbs migrate --from meson: bounded meson.build importer (project, variable
  assignments, files()/include_directories(), executable/static_library/
  shared_library/library with link_with, include_directories, dependencies,
  install/install_dir) rendering the same build.cpp scaffold; everything
  untranslated is reported as a note.
- vbs init --template app|library|header-only|shared; every template
  scaffolds a project whose own test passes.
- vbs presets --export FILE: writes VBS profiles as CMake configure presets
  (round-trips through the CMakePresets importer).
- vbs ide generate also writes JetBrains run configurations per target.
- VBS_HOST_CXX_FLAGS/VBS_HOST_LDFLAGS instrument the compiled build
  descriptor (the CI sanitizer lane sets them).
- The registry queue counts lease attempts and abandons an action after 5
  attempts into a dead-letter list instead of leasing it forever.
- CI: coverage lane (lcov report), sanitizer descriptor flags; docs ledger
  brought up to date (STATE/TASKS/superiority roadmap).

Verified: the new FullV1Tests and RegistryTests cases pass and the full
CTest suite passes 8/8.
This commit is contained in:
faumaray committed 2026-12-06 17:23:59 +03:00
1 parent 9da1387031
commit fe453bd601
17 files changed
+898 -54

No files matched your search

+133
View File
@@ -3475,6 +3475,11 @@ VOID_TEST(FullV1Tests, ide_integration_compdb_build_cpp_and_editor_configs_end_t
// Check every generated file exists and every JSON file parses strictly.
Void::Testing::expect(std::filesystem::exists(proj / ".clangd"));
Void::Testing::expect(std::filesystem::exists(proj / ".idea" / "customTargets.xml"));
// JetBrains run configurations for the scaffolded targets (shell configs).
Void::Testing::expect(std::filesystem::exists(proj / ".idea" / "runConfigurations" /
"vbs_build_ide_demo.xml"));
Void::Testing::expect(std::filesystem::exists(proj / ".idea" / "runConfigurations" /
"vbs_test_ide_demo_tests.xml"));
for (const auto &json_file : {proj / ".vscode" / "tasks.json", proj / ".vscode" / "launch.json",
proj / ".vscode" / "settings.json", proj / ".zed" / "tasks.json",
proj / ".zed" / "debug.json"}) {
@@ -4214,3 +4219,131 @@ VOID_TEST(FullV1Tests, completions_and_man_pages_are_generated_from_the_cli) {
Void::Testing::require(nested.has_value());
Void::Testing::expect(nested->find(".TH vbs\\-compdb\\-use 1") != std::string::npos);
}
// === Migration breadth: meson.build -> build.cpp scaffold ===
VOID_TEST(FullV1Tests, meson_build_import_renders_build_cpp_scaffold) {
Void::FileSystem::TempDir tmp{"vbs_meson_migrate_"};
write_file(tmp / "meson.build", R"meson(
project('bench', 'cpp', version : '1.0')
bench_sources = files('src/f1.cpp', 'src/f2.cpp')
lib = static_library('bench_lib', bench_sources,
include_directories : include_directories('include'))
app_sources = ['src/main.cpp']
executable('bench_app', app_sources,
link_with : lib,
dependencies : [dependency('zlib')],
install : true,
install_dir : 'bin')
# Not translated, must be reported.
custom_target('gen', output : 'gen.cpp', command : ['gen.sh'])
)meson");
auto imported = Config::import_meson_build(tmp / "meson.build", tmp.path());
Void::Testing::require(imported.has_value());
Void::Testing::expect_eq(imported->project_name, std::string{"bench"});
Void::Testing::expect_eq(imported->targets.size(), std::size_t{2});
const auto &library = imported->targets.at(0);
Void::Testing::expect_eq(library.name, std::string{"bench_lib"});
Void::Testing::expect_eq(library.kind, std::string{"static"});
Void::Testing::expect_eq(library.sources.size(), std::size_t{2});
Void::Testing::expect_eq(library.sources.at(0), std::string{"src/f1.cpp"});
Void::Testing::expect_eq(library.private_includes.at(0), std::string{"include"});
const auto &app = imported->targets.at(1);
Void::Testing::expect_eq(app.name, std::string{"bench_app"});
Void::Testing::expect_eq(app.kind, std::string{"executable"});
Void::Testing::expect_eq(app.sources.at(0), std::string{"src/main.cpp"});
Void::Testing::expect_eq(app.private_links.at(0), std::string{"bench_lib"});
Void::Testing::expect(app.installed);
Void::Testing::expect_eq(app.install_destination, std::string{"bin"});
bool saw_dependency_note = false;
bool saw_custom_target_note = false;
for (const auto &note : imported->notes) {
if (note.find("zlib") != std::string::npos) {
saw_dependency_note = true;
}
if (note.find("custom_target") != std::string::npos) {
saw_custom_target_note = true;
}
}
Void::Testing::expect(saw_dependency_note);
Void::Testing::expect(saw_custom_target_note);
const std::string rendered = Config::render_build_cpp(*imported);
Void::Testing::expect(rendered.find("static_library(\"bench_lib\")") != std::string::npos);
Void::Testing::expect(rendered.find("executable(\"bench_app\")") != std::string::npos);
Void::Testing::expect(rendered.find(".link(t_bench_lib") != std::string::npos);
}
// === Project templates: `vbs init --template` shapes build and test ===
VOID_TEST(FullV1Tests, init_templates_scaffold_buildable_projects) {
const auto vbs_bin = locate_vbs_binary();
Void::Testing::expect(!vbs_bin.empty() && std::filesystem::exists(vbs_bin));
if (vbs_bin.empty() || !std::filesystem::exists(vbs_bin)) {
return;
}
Void::FileSystem::TempDir tmp{"vbs_init_templates_"};
auto run_vbs = [&](std::vector<std::string> args) {
Platform::ProcessRequest req;
req.executable = vbs_bin;
req.arguments = std::move(args);
req.timeout = std::chrono::seconds{600};
return Platform::run_supervised(req);
};
for (const char *shape : {"app", "library", "header-only", "shared"}) {
const auto dir = tmp / shape;
auto initialized = run_vbs({"init", "--dir", dir.string(), "--name", "demo",
"--template", shape});
Void::Testing::expect(initialized.has_value() && initialized->succeeded());
auto built = run_vbs({"test", "--project", dir.string(),
"--build-dir", (dir / "build").string(), "--jobs", "2"});
Void::Testing::expect(built.has_value() && built->succeeded());
if (built && !built->succeeded()) {
std::cerr << "template '" << shape << "' failed:\n" << built->stderr_data << '\n';
}
}
auto bad = run_vbs({"init", "--dir", (tmp / "bogus").string(), "--template", "bogus"});
Void::Testing::expect(bad.has_value() && bad->exit_code == 2);
}
// === Presets export: VBS profiles -> CMakePresets.json (round-trips through the importer) ===
VOID_TEST(FullV1Tests, presets_export_round_trips_through_the_importer) {
const auto vbs_bin = locate_vbs_binary();
Void::Testing::expect(!vbs_bin.empty() && std::filesystem::exists(vbs_bin));
if (vbs_bin.empty() || !std::filesystem::exists(vbs_bin)) {
return;
}
Void::FileSystem::TempDir tmp{"vbs_presets_export_"};
const auto proj = tmp / "proj";
write_file(proj / "build.cpp", R"cpp(#include <Void/Build.hpp>
void build(Void::Build::Project &p) {
p.executable("app").sources({"src/main.cpp"});
}
)cpp");
write_file(proj / "src" / "main.cpp", "int main() { return 0; }\n");
const auto exported = tmp / "CMakePresets.json";
Platform::ProcessRequest req;
req.executable = vbs_bin;
req.arguments = {"presets", "--project", proj.string(), "--export", exported.string()};
req.timeout = std::chrono::seconds{300};
auto res = Platform::run_supervised(req);
Void::Testing::expect(res.has_value() && res->succeeded());
auto text = Void::FileSystem::read_file(exported);
Void::Testing::require(text.has_value());
Void::Testing::expect(text->find("\"configurePresets\"") != std::string::npos);
Void::Testing::expect(text->find("\"CMAKE_BUILD_TYPE\"") != std::string::npos);
// The exported file must be readable by the importer.
auto imported = Config::load_cmake_presets(exported, proj);
Void::Testing::require(imported.has_value());
Void::Testing::expect(!imported->empty());
for (const auto &preset : *imported) {
Void::Testing::expect(preset.build_dir.has_value());
}
}