diff options
Diffstat (limited to 'lib/common/Test.cpp')
-rw-r--r-- | lib/common/Test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/common/Test.cpp b/lib/common/Test.cpp index ba99d496..9385d8c3 100644 --- a/lib/common/Test.cpp +++ b/lib/common/Test.cpp @@ -512,3 +512,16 @@ void safe_sleep(int seconds) { ShortSleep(SecondsToBoxTime(seconds), true); } + +std::auto_ptr<Configuration> load_config_file(const std::string& config_file, + const ConfigurationVerify& verify) +{ + std::string errs; + std::auto_ptr<Configuration> config( + Configuration::LoadAndVerify(config_file, &verify, errs)); + TEST_EQUAL_LINE(0, errs.size(), "Failed to load configuration file: " + config_file + + ": " + errs); + TEST_EQUAL_OR(0, errs.size(), config.reset()); + return config; +} + |