Files
zeekay cc0aa16da7 The C++ Q, Z, D and F chains, and the half of a decision Q was missing
Four ports existed on branches nothing built and nothing ran against the
corpus. They are here so the differential has a C++ voice on the four
chains it could not see, and so that whatever they answer is answered in
public rather than in a branch.

  quantumvm  from blue/quantumvm-cpp
  zkvm       from blue/zkvm-cpp-impl
  dexvm      from blue/dexvm-cpp
  fhevm      from blue/fhevm-cpp  (with chains/cpp/zap, which it reads)

quantumvm did not build: the node's VM seam grew `Block::reject()` after
that branch was written, so VmBlock was abstract and every construction
of it was a compile error. It forwards to the block's own reject now,
and — as the seam asks and as Go's pendingBlocks.Decided does — accept
and reject are each inert once either has run.

Nothing else was changed. What these ports say about the corpus is the
next commit's business, and it is not this commit's job to make them say
anything in particular.

Verified: all four configure, build and pass their own suites here —
quantumvm 13/13, zkvm 13/13, dexvm 10/10, fhevm 14/14.
2026-09-05 13:50:41 -07:00

66 lines
1.6 KiB
C++

// Copyright (C) 2026, Lux Industries, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause-Eco
#include "harness.hpp"
#include <cstdio>
namespace qvmtest {
namespace {
struct Current {
bool failed = false;
bool skipped = false;
std::string why;
};
Current& current() {
static Current c;
return c;
}
} // namespace
std::vector<Case>& registry() {
static std::vector<Case> cases;
return cases;
}
void fail_current(const std::string& msg) {
current().failed = true;
current().why = msg;
}
void skip_current(const std::string& why) {
current().skipped = true;
current().why = why;
}
int run_all(std::string_view suite) {
int passed = 0, failed = 0, skipped = 0;
std::printf("== %.*s\n", static_cast<int>(suite.size()), suite.data());
for (const auto& c : registry()) {
current() = Current{};
c.body();
if (current().skipped) {
++skipped;
std::printf(" skipped %s (%s)\n", c.name.c_str(), current().why.c_str());
} else if (current().failed) {
++failed;
std::printf(" FAIL %s\n %s\n", c.name.c_str(), current().why.c_str());
} else {
++passed;
std::printf(" ok %s\n", c.name.c_str());
}
}
std::printf("%.*s: %d passed, %d failed, %d skipped\n", static_cast<int>(suite.size()),
suite.data(), passed, failed, skipped);
return failed == 0 ? 0 : 1;
}
} // namespace qvmtest
int main(int argc, char** argv) { return qvmtest::run_all(argc > 0 ? argv[0] : "suite"); }