FDR  4.2.7(6ecbe5a21b71ab020e8fcaeccfe5ebaad0599f4f)
assertion.h
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
6 #include <fdr/error.h>
7 #include <fdr/tasks/progress_reporter.h>
8 
9 namespace FDR
10 {
11 class Canceller;
12 class Session;
13 
14 namespace Assertions
15 {
16 class Counterexample;
17 class Progress;
18 
22 class Assertion
23 {
24 public:
25  virtual ~Assertion();
26 
27  Assertion(const Assertion& assertion) = delete;
28  Assertion& operator=(const Assertion& assertion) = delete;
29 
43  void execute(Canceller* canceller);
44 
53  const std::vector<std::shared_ptr<Counterexample>>& counterexamples() const;
54 
58  bool passed() const;
59 
64  std::shared_ptr<Progress> progress() const;
65 
70  std::string to_string() const;
71 
75  TaskId root_task_id() const;
76 
77 protected:
78  Assertion();
79 
80  friend struct AssertionFactory;
81  friend Session;
82 
83  struct Data;
84  std::shared_ptr<Data> data;
85 };
86 
87 } // end Assertions
88 } // end FDR
FDR::Assertions::Assertion::progress
std::shared_ptr< Progress > progress() const
Reports statistics about the assertion's progress.
FDR::Session
Encapsulates information about an input file.
Definition: session.h:79
FDR::Assertions::Assertion::to_string
std::string to_string() const
Returns a string representation of this assertion.
FDR::Assertions::Assertion
An assertion about processes.
Definition: assertion.h:23
FDR::Assertions::Assertion::passed
bool passed() const
If the assertion has been executed, true iff the assertion passed.
FDR::Canceller
Allows cancellation of a running task to be requested.
Definition: canceller.h:53
FDR::Assertions::Assertion::execute
void execute(Canceller *canceller)
Checks the given assertion.
FDR::Assertions::Assertion::root_task_id
TaskId root_task_id() const
Returns the identity of the task under which all tasks in this assertion will be created under.
FDR::Assertions::Assertion::counterexamples
const std::vector< std::shared_ptr< Counterexample > > & counterexamples() const
A list of counterexamples, if the assertion failed.