Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
resmon_fixture Struct Reference
Collaboration diagram for resmon_fixture:

Public Member Functions

void set_program_options ()
 
void initialize (const std::vector< std::string > &args)
 
void set_options (const std::vector< std::string > &arg)
 
void plugin_startup (const std::vector< bfs::path > &dirs, int runTimeSecs=3)
 

Public Attributes

resource_monitor_plugin _my
 
options_description _cfg
 

Detailed Description

Definition at line 20 of file test_resmon_plugin.cpp.

Member Function Documentation

◆ initialize()

void resmon_fixture::initialize ( const std::vector< std::string > & args)
inline

Definition at line 26 of file test_resmon_plugin.cpp.

26 {
27 // We only have at most 3 arguments. OK to hardcodied in test
28 // programs.
29 const char* argv[10];
30 SYS_ASSERT(args.size() < 10, chain::plugin_exception, "number of arguments (${size}) must be less than 10", ("size", args.size()));
31
32 // argv[0] is program name, no need to fill in
33 for (size_t i=0; i<args.size(); ++i) {
34 argv[i+1] = args[i].c_str();
35 }
36
37 bpo::variables_map options;
38 bpo::store(bpo::parse_command_line(args.size()+1, argv, _cfg), options);
39 bpo::notify(options);
40
41 _my.plugin_initialize(options);
42 }
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
void plugin_initialize(const variables_map &options)
char ** argv
resource_monitor_plugin _my
options_description _cfg
Here is the call graph for this function:
Here is the caller graph for this function:

◆ plugin_startup()

void resmon_fixture::plugin_startup ( const std::vector< bfs::path > & dirs,
int runTimeSecs = 3 )
inline

Definition at line 49 of file test_resmon_plugin.cpp.

49 {
50 set_options({"--resource-monitor-interval-seconds=1"});
51
52 for (auto& dir: dirs) {
54 }
55
57 std::this_thread::sleep_for( std::chrono::milliseconds(runTimeSecs*1000) );
59 }
void monitor_directory(const bfs::path &path)
void set_options(const std::vector< std::string > &arg)
Here is the call graph for this function:

◆ set_options()

void resmon_fixture::set_options ( const std::vector< std::string > & arg)
inline

Definition at line 44 of file test_resmon_plugin.cpp.

44 {
46 initialize(arg);
47 }
void initialize(const std::vector< std::string > &args)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_program_options()

void resmon_fixture::set_program_options ( )
inline

Definition at line 21 of file test_resmon_plugin.cpp.

21 {
22 options_description dummy;
24 }
virtual void set_program_options(options_description &, options_description &cfg) override
constexpr enabler dummy
An instance to use in EnableIf.
Definition CLI11.hpp:856
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _cfg

options_description resmon_fixture::_cfg

Definition at line 62 of file test_resmon_plugin.cpp.

◆ _my

resource_monitor_plugin resmon_fixture::_my

Definition at line 61 of file test_resmon_plugin.cpp.


The documentation for this struct was generated from the following file: