59TEST_CASE(
"Configuring xInstGraph with no errors",
"[xInstGraph]" )
61 mx::ioutils::createDirectories(
"/tmp/xInstGraph_test/config");
65 SECTION(
"A valid configuration with each node type" )
67 std::vector<std::string> sections;
68 std::vector<std::string> keys;
69 std::vector<std::string> values;
71 sections.insert(sections.end(), {
"graph",
"graph"});
72 keys.insert(keys.end(), {
"file",
"outputPath"});
73 values.insert(values.end(), {
"instgraph_test.drawio",
"/tmp/xInstGraph_test/instgraph_test_out.drawio"});
75 sections.insert(sections.end(), {
"indiPropNode",
"indiPropNode",
"indiPropNode",
"indiPropNode"});
76 keys.insert(keys.end(), {
"type",
"propKey",
"propEl",
"propVal"});
77 values.insert(values.end(), {
"indiProp",
"test.test",
"test",
"test"});
79 sections.insert(sections.end(), {
"pwrOnOffNode",
"pwrOnOffNode"});
80 keys.insert(keys.end(), {
"type",
"pwrKey"});
81 values.insert(values.end(), {
"pwrOnOff",
"testpwr.test"});
83 sections.insert(sections.end(), {
"fsmNode"});
84 keys.insert(keys.end(), {
"type"});
85 values.insert(values.end(), {
"fsm"});
87 sections.insert(sections.end(), {
"stdMotionNode"});
88 keys.insert(keys.end(), {
"type"});
89 values.insert(values.end(), {
"stdMotion"});
91 sections.insert(sections.end(), {
"staticNode"});
92 keys.insert(keys.end(), {
"type"});
93 values.insert(values.end(), {
"static"});
95 mx::app::writeConfigFile(
"/tmp/xInstGraph_test/config/instgraph_test.conf", sections, keys, values);
98 xig.
configDir(
"/tmp/xInstGraph_test/config");
107 xig.
config().readConfig(
"/tmp/xInstGraph_test/config/instgraph_test.conf");
115 pcf::IndiProperty ip;
116 ip.setDevice(
"testpwr");
118 ip.add(pcf::IndiElement(
"state"));
124 bool ex = std::filesystem::exists(
"/tmp/xInstGraph_test/instgraph_test_out.drawio");
132 ex = std::filesystem::exists(
"/tmp/xInstGraph_test/instgraph_test_out.drawio");
133 REQUIRE(ex ==
false);