#ifndef GLBACKEND_TESTS_COMMON_RUN_HPP_ #define GLBACKEND_TESTS_COMMON_RUN_HPP_ #include #include #include #include // NOLINTNEXTLINE #define STR_EXCEPTION GLBase::Exception #include #define GLBACKEND_TESTS_COMMON_RUN(GLBACKEND) \ run(#GLBACKEND); constexpr auto size = std::array{640, 480}; template inline void run(std::string const & name) { GLBackend::prefix("assets/tests"); auto backend = GLBackend(name, size); std::cout << backend.debug_info() << std::endl; backend.callback_render([&]() { glClearColor(1.0F, 0.0F, 0.0F, 0.5F); glClear(GL_COLOR_BUFFER_BIT); if (!backend.tga_compare(name + ".tga", true)) STR_THROW("Frame did not match expected frame."); backend.running(false); }); backend.run(); } #endif