Files
moloapp/tests/src/clients/main.cpp
T
retoor 3c4334cec9 feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security,
data, app, realtime, supervisor, clients, CLI, example plus
enterprise tenancy, audit, operability, governance,
supplychain. Postgres via docker compose for tests.
2026-10-23 18:20:04 +02:00

45 lines
1.2 KiB
C++

#include "framework.h"
#include <cstdlib>
#include <iostream>
namespace clients_test {
int run_all() {
// Loopback tests must never be proxied; proxy tests set their own env.
unsetenv("HTTP_PROXY");
unsetenv("HTTPS_PROXY");
unsetenv("NO_PROXY");
unsetenv("http_proxy");
unsetenv("https_proxy");
unsetenv("no_proxy");
int passed = 0;
int failed = 0;
for (const auto& test : registry()) {
try {
test.fn();
++passed;
std::cout << "ok " << test.suite << "." << test.name << "\n";
} catch (const Failure& err) {
++failed;
std::cout << "FAIL " << test.suite << "." << test.name << ": " << err.what()
<< "\n";
} catch (const std::exception& err) {
++failed;
std::cout << "FAIL " << test.suite << "." << test.name
<< ": uncaught std::exception: " << err.what() << "\n";
} catch (...) {
++failed;
std::cout << "FAIL " << test.suite << "." << test.name
<< ": uncaught unknown exception\n";
}
}
std::cout << "passed " << passed << " failed " << failed << " total "
<< (passed + failed) << "\n";
return failed == 0 ? 0 : 1;
}
} // namespace clients_test
int main() { return clients_test::run_all(); }