Default output dir is current active directory
Optionally specify using IOCondig::setOutputDir()
This commit is contained in:
@@ -49,12 +49,9 @@ namespace Opm {
|
||||
m_FMTOUT(false),
|
||||
m_ignore_RPTSCHED_RESTART(false),
|
||||
m_deck_filename(input_path),
|
||||
m_output_enabled(true)
|
||||
m_output_enabled(true),
|
||||
m_output_dir(".")
|
||||
{
|
||||
m_output_dir = boost::filesystem::path(input_path).parent_path().string();
|
||||
if (m_output_dir.length() < 1) {
|
||||
m_output_dir = ".";
|
||||
}
|
||||
m_base_name = boost::filesystem::path(input_path).stem().string();
|
||||
}
|
||||
|
||||
|
||||
@@ -466,15 +466,19 @@ BOOST_AUTO_TEST_CASE(IOConfigTest) {
|
||||
|
||||
BOOST_CHECK_EQUAL("", ioConfigPtr5->getDeckFileName());
|
||||
|
||||
std::string testString = "testString";
|
||||
std::string testString = "testString.DATA";
|
||||
IOConfigPtr ioConfigPtr6 = std::make_shared<IOConfig>(testString);
|
||||
std::string output_dir6 = ".";
|
||||
ioConfigPtr6->setOutputDir(output_dir6);
|
||||
BOOST_CHECK_EQUAL(testString, ioConfigPtr6->getDeckFileName());
|
||||
BOOST_CHECK_EQUAL(".", ioConfigPtr6->getOutputDir());
|
||||
BOOST_CHECK_EQUAL(output_dir6, ioConfigPtr6->getOutputDir());
|
||||
|
||||
std::string absTestPath = "/path/to/testString.DATA";
|
||||
std::string absTestPath = "testString.DATA";
|
||||
IOConfigPtr ioConfigPtr7 = std::make_shared<IOConfig>(absTestPath);
|
||||
std::string output_dir7 = "/path/to";
|
||||
ioConfigPtr7->setOutputDir(output_dir7);
|
||||
BOOST_CHECK_EQUAL(absTestPath, ioConfigPtr7->getDeckFileName());
|
||||
BOOST_CHECK_EQUAL("/path/to", ioConfigPtr7->getOutputDir());
|
||||
BOOST_CHECK_EQUAL(output_dir7, ioConfigPtr7->getOutputDir());
|
||||
BOOST_CHECK_EQUAL("testString", ioConfigPtr7->getBaseName());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user