/* * Copyright (c) 2024, Andrew Kaster * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Ladybird { class Fixture { public: virtual ~Fixture(); virtual ErrorOr setup() = 0; void teardown() { if (is_running()) teardown_impl(); } virtual StringView name() const = 0; virtual bool is_running() const { return false; } static void initialize_fixtures(); static Optional lookup(StringView name); static Vector>& all(); protected: virtual void teardown_impl() = 0; }; }