xref: /freebsd/contrib/kyua/engine/debugger.hpp (revision 6b8222793fbb4c0e162232716bc454dad31b709f)
1*6b822279SIgor Ostapenko // Copyright 2025 The Kyua Authors.
2*6b822279SIgor Ostapenko // All rights reserved.
3*6b822279SIgor Ostapenko //
4*6b822279SIgor Ostapenko // Redistribution and use in source and binary forms, with or without
5*6b822279SIgor Ostapenko // modification, are permitted provided that the following conditions are
6*6b822279SIgor Ostapenko // met:
7*6b822279SIgor Ostapenko //
8*6b822279SIgor Ostapenko // * Redistributions of source code must retain the above copyright
9*6b822279SIgor Ostapenko //   notice, this list of conditions and the following disclaimer.
10*6b822279SIgor Ostapenko // * Redistributions in binary form must reproduce the above copyright
11*6b822279SIgor Ostapenko //   notice, this list of conditions and the following disclaimer in the
12*6b822279SIgor Ostapenko //   documentation and/or other materials provided with the distribution.
13*6b822279SIgor Ostapenko // * Neither the name of Google Inc. nor the names of its contributors
14*6b822279SIgor Ostapenko //   may be used to endorse or promote products derived from this software
15*6b822279SIgor Ostapenko //   without specific prior written permission.
16*6b822279SIgor Ostapenko //
17*6b822279SIgor Ostapenko // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18*6b822279SIgor Ostapenko // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19*6b822279SIgor Ostapenko // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20*6b822279SIgor Ostapenko // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21*6b822279SIgor Ostapenko // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22*6b822279SIgor Ostapenko // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23*6b822279SIgor Ostapenko // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24*6b822279SIgor Ostapenko // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25*6b822279SIgor Ostapenko // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26*6b822279SIgor Ostapenko // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27*6b822279SIgor Ostapenko // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*6b822279SIgor Ostapenko 
29*6b822279SIgor Ostapenko /// \file engine/debugger.hpp
30*6b822279SIgor Ostapenko /// The interface between the engine and the users outside.
31*6b822279SIgor Ostapenko 
32*6b822279SIgor Ostapenko #if !defined(ENGINE_DEBUGGER_HPP)
33*6b822279SIgor Ostapenko #define ENGINE_DEBUGGER_HPP
34*6b822279SIgor Ostapenko 
35*6b822279SIgor Ostapenko #include "model/test_case_fwd.hpp"
36*6b822279SIgor Ostapenko #include "model/test_program_fwd.hpp"
37*6b822279SIgor Ostapenko #include "model/test_result_fwd.hpp"
38*6b822279SIgor Ostapenko #include "utils/optional_fwd.hpp"
39*6b822279SIgor Ostapenko #include "utils/process/executor_fwd.hpp"
40*6b822279SIgor Ostapenko 
41*6b822279SIgor Ostapenko namespace executor = utils::process::executor;
42*6b822279SIgor Ostapenko 
43*6b822279SIgor Ostapenko using utils::optional;
44*6b822279SIgor Ostapenko 
45*6b822279SIgor Ostapenko 
46*6b822279SIgor Ostapenko namespace engine {
47*6b822279SIgor Ostapenko 
48*6b822279SIgor Ostapenko 
49*6b822279SIgor Ostapenko /// Abstract debugger interface.
50*6b822279SIgor Ostapenko class debugger {
51*6b822279SIgor Ostapenko public:
debugger()52*6b822279SIgor Ostapenko     debugger() {}
~debugger()53*6b822279SIgor Ostapenko     virtual ~debugger() {}
54*6b822279SIgor Ostapenko 
55*6b822279SIgor Ostapenko     /// Called right before test cleanup.
56*6b822279SIgor Ostapenko     virtual void before_cleanup(
57*6b822279SIgor Ostapenko         const model::test_program_ptr&,
58*6b822279SIgor Ostapenko         const model::test_case&,
59*6b822279SIgor Ostapenko         optional< model::test_result >&,
60*6b822279SIgor Ostapenko         executor::exit_handle&) const = 0;
61*6b822279SIgor Ostapenko };
62*6b822279SIgor Ostapenko 
63*6b822279SIgor Ostapenko 
64*6b822279SIgor Ostapenko /// Pointer to a debugger implementation.
65*6b822279SIgor Ostapenko typedef std::shared_ptr< debugger > debugger_ptr;
66*6b822279SIgor Ostapenko 
67*6b822279SIgor Ostapenko 
68*6b822279SIgor Ostapenko }  // namespace engine
69*6b822279SIgor Ostapenko 
70*6b822279SIgor Ostapenko 
71*6b822279SIgor Ostapenko #endif  // !defined(ENGINE_DEBUGGER_HPP)
72