feat: adopt VoidLibrary VL-001..VL-013, self-building build.cpp, live logs, and generated CLI help
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 10s

This commit is contained in:
faumaray committed 2026-11-27 01:43:06 +03:00
1 parent ab64147f9d
commit 363fb8200e
33 files changed
+1754 -3155

No files matched your search

+18 -14
View File
@@ -14,27 +14,31 @@ function(check_process expected_code expected_out_regex expected_err_regex)
endif()
endfunction()
check_process(0 "Usage: vbs <command>" "" )
check_process(0 "Usage: vbs <command>" "" --help)
check_process(0 "Usage: vbs <command>" "" -h)
check_process(0 "Usage: vbs .*<command>.*Commands:" "" )
check_process(0 "Usage: vbs .*<command>.*Commands:" "" --help)
check_process(0 "Usage: vbs .*<command>.*Commands:" "" -h)
check_process(0 "^vbs ${VBS_VERSION}\n$" "" --version)
check_process(0 "^vbs ${VBS_VERSION}\n$" "" -V)
check_process(2 "" "--help must be used alone" --help --invalid)
check_process(2 "" "unexpected argument after --version" --version --invalid)
check_process(2 "" "unknown command 'invalid'" invalid)
check_process(0 "Usage: vbs build" "" build --help)
check_process(0 "Usage: vbs test" "" test --help)
check_process(2 "" "unknown option: --invalid" --version --invalid)
check_process(2 "" "--version cannot be combined with subcommands" --version build)
check_process(2 "" "unknown subcommand: invalid" invalid)
check_process(0 "Usage: vbs build .*--profile.*\\(repeatable\\)" "" build --help)
check_process(0 "Usage: vbs test " "" test --help)
check_process(2 "" "multi-profile build requires --editor-profile" build --profile debug --profile release)
check_process(2 "" "must be one of the requested profiles" build --profile debug --profile release --editor-profile custom)
check_process(2 "" "expected subcommand" compdb)
check_process(2 "" "unknown subcommand" compdb bogus)
check_process(2 "" "expected 'resolve' or 'update'" deps)
check_process(0 "Usage: vbs compdb <command>.*Commands:.*use.*show.*export.*watch" "" compdb --help)
check_process(0 "Usage: vbs compdb use " "" compdb use --help)
check_process(2 "" "missing subcommand for 'vbs compdb'" compdb)
check_process(2 "" "unknown subcommand: bogus" compdb bogus)
check_process(0 "Usage: vbs deps <command>.*Commands:.*resolve.*update" "" deps --help)
check_process(0 "Usage: vbs deps resolve " "" deps resolve --help)
check_process(2 "" "missing subcommand for 'vbs deps'" deps)
check_process(2 "" "--request and --output are required" bridge)
check_process(0 "Usage: vbs install" "" install --help)
check_process(0 "Usage: vbs install " "" install --help)
check_process(2 "" "--prefix is required" install)
check_process(2 "" "--prefix is required" uninstall)
check_process(2 "" "--input and --output-dir are required" gen-tests)
check_process(0 "Usage: vbs publish" "" publish --help)
check_process(0 "Usage: vbs publish " "" publish --help)
check_process(2 "" "--registry, --name, and --version are required" publish)
execute_process(COMMAND "${VBS_REGISTRY}" --help
@@ -42,4 +46,4 @@ execute_process(COMMAND "${VBS_REGISTRY}" --help
if(NOT "${reg_code}" STREQUAL "0" OR NOT reg_out MATCHES "Usage: vbs-registry")
message(FATAL_ERROR "vbs-registry --help failed: code=${reg_code}\nstdout=[${reg_out}]\nstderr=[${reg_err}]")
endif()
message(STATUS "23 native CLI contracts verified")
message(STATUS "27 native CLI and auto-generated Argparse help contracts verified")
+23 -7
View File
@@ -35,13 +35,23 @@ foreach(profile IN ITEMS debug release)
expect_json(file targets 0 sources 0 kind)
expect_json(src/Build.cpp targets 0 sources 0 path)
expect_json(public targets 0 include_directories 0 visibility)
expect_json(vbs targets 1 name)
expect_json(executable targets 1 kind)
expect_json(VoidBuildCore targets 1 name)
expect_json(static_library targets 1 kind)
expect_json(VoidBuildSdk targets 1 links 0 target)
expect_json(private targets 1 links 0 visibility)
expect_json(public targets 1 links 0 visibility)
expect_json(VoidLibrary targets 1 links 1 dependency)
expect_json(Void::Configuration targets 1 links 1 target)
foreach(index IN ITEMS 0 1)
expect_json(GenerateBootstrapConfig targets 2 name)
expect_json(custom_action targets 2 kind)
expect_json(vbs targets 3 name)
expect_json(executable targets 3 kind)
expect_json(VoidBuildCore targets 3 links 0 target)
expect_json(private targets 3 links 0 visibility)
expect_json(VoidBuildRegistry targets 4 name)
expect_json(static_library targets 4 kind)
expect_json(vbs-registry targets 5 name)
expect_json(executable targets 5 kind)
foreach(index IN ITEMS 0 1 3 4 5)
if(compiler STREQUAL "gcc")
expect_json(-Wduplicated-cond targets "${index}" compile_options 2)
else()
@@ -49,7 +59,7 @@ foreach(profile IN ITEMS debug release)
endif()
endforeach()
expect_json(git dependencies 0 source kind)
expect_json(9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5 dependencies 0 source revision)
expect_json(3e254055e081a104f08df68dde39711bc7813518 dependencies 0 source revision)
expect_json(cmake dependencies 0 builder)
string(JSON option_type TYPE "${graph}" dependencies 0 options BUILD_SHARED_LIBS)
if(NOT option_type STREQUAL "BOOLEAN")
@@ -58,6 +68,13 @@ foreach(profile IN ITEMS debug release)
endforeach()
endforeach()
execute_process(COMMAND "${DESCRIBE}" --help
RESULT_VARIABLE help_code OUTPUT_VARIABLE help_out ERROR_VARIABLE help_err TIMEOUT 10)
if(NOT "${help_code}" STREQUAL "0" OR NOT "${help_err}" STREQUAL "" OR
NOT help_out MATCHES "Usage: vbs_describe")
message(FATAL_ERROR "vbs_describe --help failed: code=${help_code}\nstdout=[${help_out}]\nstderr=[${help_err}]")
endif()
function(expect_error expected)
execute_process(COMMAND "${DESCRIBE}" ${ARGN}
RESULT_VARIABLE code OUTPUT_VARIABLE out ERROR_VARIABLE err TIMEOUT 10)
@@ -71,5 +88,4 @@ expect_error("unknown compiler 'msvc' (expected gcc or clang)" --compiler msvc)
expect_error("option '--profile' requires a value" --profile)
expect_error("unknown option: --invalid" --invalid)
expect_error("unexpected positional argument: invalid" invalid)
expect_error("--help must be used alone" --help --invalid)
message(STATUS "Four runtime profile/compiler contexts and six error contracts verified")
message(STATUS "Four runtime profile/compiler contexts, generated help, and five error contracts verified")
+13 -2
View File
@@ -13,7 +13,11 @@ Void::Testing::Test example_uses_runtime_compiler() {
definitions.resolve("debug", Void::Build::CompilerFamily::Clang, "linux", "x86_64")};
build(gcc);
build(clang);
Void::Testing::expect_eq(gcc.targets().size(), clang.targets().size());
for (std::size_t index = 0; index < gcc.targets().size(); ++index) {
if (gcc.targets().at(index).kind == Void::Build::TargetKind::CustomAction) {
continue;
}
Void::Testing::expect(std::ranges::contains(gcc.targets().at(index).compile_options,
std::string{"-Wduplicated-cond"}));
Void::Testing::expect(!std::ranges::contains(gcc.targets().at(index).compile_options,
@@ -47,15 +51,22 @@ Void::Testing::Test example_records_sources_links_and_pin() {
Void::Build::Project project{Void::Build::default_profiles().resolve(
"debug", Void::Build::CompilerFamily::Gcc, "linux", "x86_64")};
build(project);
Void::Testing::expect_eq(project.targets().size(), std::size_t{2});
Void::Testing::expect_eq(project.targets().size(), std::size_t{6});
Void::Testing::expect_eq(project.targets().at(0).name, std::string{"VoidBuildSdk"});
Void::Testing::expect_eq(project.targets().at(0).sources.at(0).path,
std::string{"src/Build.cpp"});
Void::Testing::expect_eq(project.targets().at(1).name, std::string{"VoidBuildCore"});
Void::Testing::expect_eq(project.targets().at(1).links.at(0).target,
std::string{"VoidBuildSdk"});
Void::Testing::expect_eq(project.targets().at(1).links.at(1).target,
std::string{"Void::Configuration"});
Void::Testing::expect_eq(project.targets().at(2).name, std::string{"GenerateBootstrapConfig"});
Void::Testing::expect_eq(project.targets().at(3).name, std::string{"vbs"});
Void::Testing::expect_eq(project.targets().at(3).links.at(0).target,
std::string{"VoidBuildCore"});
Void::Testing::expect_eq(project.targets().at(4).name, std::string{"VoidBuildRegistry"});
Void::Testing::expect_eq(project.targets().at(5).name, std::string{"vbs-registry"});
Void::Testing::expect_eq(project.dependencies().at(0).revision,
std::string{"9931c5ffc4844a5e09e1b1db35b3d29c5097c3a5"});
std::string{"3e254055e081a104f08df68dde39711bc7813518"});
Void::Testing::expect_eq(project.dependencies().at(0).builder, std::string{"cmake"});
}