#ifndef DOCTEST_PARTS_PUBLIC_CONTEXT
#define DOCTEST_PARTS_PUBLIC_CONTEXT

#include "doctest/parts/public/assert/data.h"

DOCTEST_SUPPRESS_PUBLIC_WARNINGS_PUSH

namespace doctest {

DOCTEST_INTERFACE extern bool is_running_in_test;

namespace detail {
using assert_handler = void (*)(const AssertData &);
struct ContextState;
} // namespace detail

class DOCTEST_INTERFACE Context {
    detail::ContextState *p;

    void parseArgs(int argc, const char *const *argv, bool withDefaults = false);

public:
    explicit Context(int argc = 0, const char *const *argv = nullptr);

    Context(const Context &) = delete;
    Context(Context &&) = delete;

    Context &operator=(const Context &) = delete;
    Context &operator=(Context &&) = delete;

    ~Context(); // NOLINT(performance-trivially-destructible)

    void applyCommandLine(int argc, const char *const *argv);

    void addFilter(const char *filter, const char *value);
    void clearFilters();
    void setOption(const char *option, bool value);
    void setOption(const char *option, int value);
    void setOption(const char *option, const char *value);

    bool shouldExit();

    void setAsDefaultForAssertsOutOfTestCases();

    void setAssertHandler(detail::assert_handler ah);

    void setCout(std::ostream *out);

    int run();
};
} // namespace doctest

DOCTEST_SUPPRESS_PUBLIC_WARNINGS_POP

#endif // DOCTEST_PARTS_PUBLIC_CONTEXT
