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
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
goto_modelt
Definition: goto_model.h:25
harness_options_parser::require_exactly_one_value
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...
Definition: goto_harness_generator.cpp:21
goto_harness_generatort
Definition: goto_harness_generator.h:41
goto_harness_generatort::handle_option
virtual void handle_option(const std::string &option, const std::list< std::string > &values)=0
Handle a command line argument.
goto_harness_generator_factoryt
helper to select harness type by name.
Definition: goto_harness_generator_factory.h:33
harness_options_parser
Definition: goto_harness_generator.cpp:19
harness_options_parser::require_one_size_value
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...
Definition: goto_harness_generator.cpp:41
goto_harness_generatort::validate_options
virtual void validate_options(const goto_modelt &goto_model)=0
Check if options are in a sane state, throw otherwise.
harness_options_parser::assert_no_values
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.
Definition: goto_harness_generator.cpp:34
goto_harness_generatort::~goto_harness_generatort
virtual ~goto_harness_generatort()=default
goto_harness_generatort::generate
virtual void generate(goto_modelt &goto_model, const irep_idt &harness_function_name)=0
Generate a harness according to the set options.
irep.h