CBMC
goto_harness_generator.h
Go to the documentation of this file.
1 /******************************************************************\
2 
3 Module: goto_harness_generator
4 
5 Author: Diffblue Ltd.
6 
7 \******************************************************************/
8 
9 #ifndef CPROVER_GOTO_HARNESS_GOTO_HARNESS_GENERATOR_H
10 #define CPROVER_GOTO_HARNESS_GOTO_HARNESS_GENERATOR_H
11 
12 #include <list>
13 #include <string>
14 
15 #include <util/irep.h>
16 
17 class goto_modelt;
18 
19 // NOLINTNEXTLINE(readability/namespace)
20 namespace harness_options_parser
21 {
24 std::string require_exactly_one_value(
25  const std::string &option,
26  const std::list<std::string> &values);
27 
29 void assert_no_values(
30  const std::string &option,
31  const std::list<std::string> &values);
32 
35 std::size_t require_one_size_value(
36  const std::string &option,
37  const std::list<std::string> &values);
38 // NOLINTNEXTLINE(readability/namespace)
39 } // namespace harness_options_parser
40 
42 {
43 public:
45  virtual void
46  generate(goto_modelt &goto_model, const irep_idt &harness_function_name) = 0;
47 
48  virtual ~goto_harness_generatort() = default;
50 
51 protected:
55  virtual void handle_option(
56  const std::string &option,
57  const std::list<std::string> &values) = 0;
58 
60  virtual void validate_options(const goto_modelt &goto_model) = 0;
61 };
62 
63 #endif // CPROVER_GOTO_HARNESS_GOTO_HARNESS_GENERATOR_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
helper to select harness type by name.
virtual void handle_option(const std::string &option, const std::list< std::string > &values)=0
Handle a command line argument.
virtual void validate_options(const goto_modelt &goto_model)=0
Check if options are in a sane state, throw otherwise.
virtual void generate(goto_modelt &goto_model, const irep_idt &harness_function_name)=0
Generate a harness according to the set options.
virtual ~goto_harness_generatort()=default
std::string require_exactly_one_value(const std::string &option, const std::list< std::string > &values)
Returns the only value of a single element list, throws an exception if not passed a single element l...
void assert_no_values(const std::string &option, const std::list< std::string > &values)
Asserts that the list of values to an option passed is empty.
std::size_t require_one_size_value(const std::string &option, const std::list< std::string > &values)
Returns the only Nat value of a single element list, throws an exception if not passed a single eleme...