feat: add Plan 20 Slice 1 CMake native translation, self-test smoke target, VL-009 VOID_TEST check, and warm-cache hardening
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 5s
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 5s
This commit is contained in:
1 parent
363fb8200e
commit
d3d2666965
19 files changed
+1466
-65
No files matched your search
@@ -0,0 +1,57 @@
|
||||
#include <Void/Build.hpp>
|
||||
#include <Void/Build/Package/Solver.hpp>
|
||||
#include <Void/Build/Package/Toml.hpp>
|
||||
#include <Void/Build/Util/Sha256.hpp>
|
||||
#include <Void/Configuration/Argparse.hpp>
|
||||
#include <Void/Text/Semver.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
int main() {
|
||||
// 1. SDK graph evaluation & deterministic UTF-8 JSON.
|
||||
auto ctx = Void::Build::default_profiles().resolve("debug", Void::Build::CompilerFamily::Gcc,
|
||||
"Linux", "x86_64");
|
||||
Void::Build::Project p{ctx};
|
||||
p.executable("smoke_app").sources({"src/main.cpp"});
|
||||
if (p.to_json().find("\"smoke_app\"") == std::string::npos) {
|
||||
std::cerr << "SelfBuildSmoke: SDK JSON serialization failed\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 2. Void::Crypto built-in FIPS 180-4 SHA-256 (VL-007).
|
||||
if (Void::Build::Util::sha256_hex("abc") !=
|
||||
"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad") {
|
||||
std::cerr << "SelfBuildSmoke: Void::Crypto SHA-256 mismatch\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 3. Void::Data::Toml 1.0 parser (VL-002).
|
||||
auto toml = Void::Build::Package::parse_toml("[dependencies.demo]\nversion = \"^1.0\"\n");
|
||||
if (!toml || !toml->contains("dependencies")) {
|
||||
std::cerr << "SelfBuildSmoke: Void::Data::Toml parse failed\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 4. Void::Semver shorthand range parser (VL-013).
|
||||
auto range = Void::Semver::parse_range("^1.0");
|
||||
auto v12 = Void::Semver::parse_strict("1.2.3");
|
||||
auto v20 = Void::Semver::parse_strict("2.0.0");
|
||||
if (!range || !v12 || !v20 || !range->contains(*v12) || range->contains(*v20)) {
|
||||
std::cerr << "SelfBuildSmoke: Void::Semver shorthand range failed\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 5. Void::Argparse::Parser native subcommands & auto-generated help (VL-011).
|
||||
Void::Argparse::Parser parser{"smoke", "Self-build smoke CLI."};
|
||||
parser.subcommand("run", "Run smoke command");
|
||||
const char *argv_help[] = {"smoke", "--help"};
|
||||
const auto help_res = parser.parse_detailed(2, argv_help);
|
||||
if (!help_res.is_help() || help_res.message.find("Commands:") == std::string::npos) {
|
||||
std::cerr << "SelfBuildSmoke: Void::Argparse generated help failed\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::cout << "SelfBuildSmoke: all 5 VoidBuildSystem + VoidLibrary runtime checks passed\n";
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user