regulators: Create TemporaryFile class
Create class for handling temporary files:
* Constructor creates the temporary file
* Destructor deletes the temporary file
* Provides move constructor and move assignment operator so that class
can be stored in containers like std::vector
* Throws exception if errors occur creating or deleting the temporary file
This class is an enhanced version of the TmpFile class in the test
directory. A future commit will delete TmpFile and modify testcases to
use TemporaryFile instead.
Tested:
* Created automated tests for most of the code in the class.
* Manually tested some error cases that were difficult to automate.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: Ieda58f4d2738dc4f184232936bc082c0d3a93fa0
diff --git a/phosphor-regulators/test/meson.build b/phosphor-regulators/test/meson.build
index 8bf6a5c..511695a 100644
--- a/phosphor-regulators/test/meson.build
+++ b/phosphor-regulators/test/meson.build
@@ -20,6 +20,7 @@
'rule_tests.cpp',
'sensor_monitoring_tests.cpp',
'system_tests.cpp',
+ 'temporary_file_tests.cpp',
'write_verification_error_tests.cpp',
'actions/action_environment_tests.cpp',