#pragma once // Shared test support for the living example suite. Not a test itself: every // test file owns one main() and uses these helpers for loud assertions. #include #include #include "app/App.hpp" #include "fw/TestClient.hpp" namespace molo::example::test { inline int g_failures = 0; inline void check(bool cond, const std::string& what) { if (cond) { std::cout << " ok: " << what << "\n"; } else { ++g_failures; std::cout << " FAIL: " << what << "\n"; } } inline bool contains(const std::string& hay, const std::string& needle) { return hay.find(needle) != std::string::npos; } inline int finish(const std::string& name) { if (g_failures == 0) { std::cout << "PASS: " << name << "\n"; return 0; } std::cout << "FAIL: " << name << " (" << g_failures << " failures)\n"; return 1; } struct Fixture { molo::example::app::Services services; std::shared_ptr app; std::shared_ptr client; Fixture() { app = molo::example::app::build_application(services); client = std::make_shared(app); } }; } // namespace molo::example::test