MCPcopy Create free account
hub / github.com/ashaduri/gsmartcontrol / main

Function main

src/applib/examples/example_smartctl_executor.cpp:24–56  ·  view source on GitHub ↗

Main function of the test

Source from the content-addressed store, hash-verified

22
23/// Main function of the test
24int main(int argc, char** argv)
25{
26 return hz::main_exception_wrapper([&argc, &argv]()
27 {
28 Gtk::Main m(argc, argv);
29
30 // NOTE: Don't use long options (e.g. --info). Use short ones (e.g. -i),
31 // because long options may be unsupported on some platforms.
32
33 // SmartctlExecutor ex("smartctl", "-i /dev/sda");
34 // SmartctlExecutorGui ex("ls", "-l --color=no -R /dev");
35 // SmartctlExecutorGui ex("lsa", "-1 --color=no /sys/block");
36 // SmartctlExecutorGui ex("../../../0test_binary.sh", "");
37 SmartctlExecutor ex("../../../0test_binary.sh", {});
38
39 ex.execute();
40
41 const std::string out_str = ex.get_stdout_str();
42 // std::cout << "OUT:\n" << out_str << "\n\n";
43 std::cerr << "OUT SIZE: " << out_str.size() << "\n";
44
45 std::cerr << "STDERR:\n" << ex.get_stderr_str() << "\n";
46
47 std::cerr << "ERROR MSG:\n";
48 std::cerr << ex.get_error_msg();
49
50 // execute it second time
51 ex.execute();
52
53 // m.run();
54 return EXIT_SUCCESS;
55 });
56}
57
58
59

Callers

nothing calls this directly

Calls 6

main_exception_wrapperFunction · 0.85
get_error_msgMethod · 0.80
executeMethod · 0.45
get_stdout_strMethod · 0.45
sizeMethod · 0.45
get_stderr_strMethod · 0.45

Tested by

no test coverage detected