core: add test-name filters to the vtest harness

run_all() takes an optional substring list; vtest_main forwards argv and a
comma-separated $VT_ONLY. No filter => run everything, as before. Makes
iterating on one slow end-to-end case (the engine suite) practical
without a framework swap.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HPPSGhiArbvQgwC2DNiURS
This commit is contained in:
2026-09-10 20:19:11 +04:00
co-authored by Claude Sonnet 5
parent afaded85f8
commit efbf366c18
2 changed files with 34 additions and 3 deletions
+9 -1
View File
@@ -81,9 +81,17 @@ std::string show(const T &v) {
}
}
inline int run_all() {
inline int run_all(const std::vector<std::string> &filters = {}) {
int failed_cases = 0;
for (const auto &c : registry()) {
if (!filters.empty()) {
bool match = false;
for (const auto &f : filters)
if (std::string_view(c.name).find(f) != std::string_view::npos)
match = true;
if (!match)
continue;
}
int before = stats().failures;
stats().current_fatal = false;
std::fprintf(stderr, "[ RUN ] %s\n", c.name);