regulators: Add log_phase_fault to parser
Enhance the JSON configuration file parser to support the new
log_phase_fault action.
Add gtest test cases to exercise new code.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I8ef9974df8ca8be07dd284552bd978802f502338
diff --git a/phosphor-regulators/src/config_file_parser.hpp b/phosphor-regulators/src/config_file_parser.hpp
index a1bdd6e..63c8bf8 100644
--- a/phosphor-regulators/src/config_file_parser.hpp
+++ b/phosphor-regulators/src/config_file_parser.hpp
@@ -31,6 +31,7 @@
#include "i2c_write_byte_action.hpp"
#include "i2c_write_bytes_action.hpp"
#include "if_action.hpp"
+#include "log_phase_fault_action.hpp"
#include "not_action.hpp"
#include "or_action.hpp"
#include "phase_fault.hpp"
@@ -516,6 +517,19 @@
std::string parseInventoryPath(const nlohmann::json& element);
/**
+ * Parses a JSON element containing a log_phase_fault action.
+ *
+ * Returns the corresponding C++ LogPhaseFaultAction object.
+ *
+ * Throws an exception if parsing fails.
+ *
+ * @param element JSON element
+ * @return LogPhaseFaultAction object
+ */
+std::unique_ptr<LogPhaseFaultAction>
+ parseLogPhaseFault(const nlohmann::json& element);
+
+/**
* Parses a JSON element containing a not action.
*
* Returns the corresponding C++ NotAction object.