Make Most Unit Tests Independent of LibECL

This commit switches a set of OPM-Common's unit tests away from
using direct calls to libecl functions and into using base types
from OPM-Common itself (along with Boost.Filesystem).

In particular summary related queries are replaced by calls to ESmry
member functions (wrapped in libecl-like interfaces to minimise code
changes).  We disable checks on unit strings since ESmry currently
does not have a way of associating those with individual variables.
This commit is contained in:
Bård Skaflestad
2019-10-14 06:13:38 -05:00
parent bcfe700461
commit c013639b51
7 changed files with 157 additions and 82 deletions
+5 -9
View File
@@ -17,11 +17,7 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#define BOOST_TEST_MODULE InitConfigTests
#include <sys/stat.h>
#include <sys/types.h>
#include <boost/test/unit_test.hpp>
@@ -31,7 +27,7 @@
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
#include <opm/parser/eclipse/Units/Units.hpp>
#include <ert/util/test_work_area.hpp>
#include <tests/WorkArea.cpp>
using namespace Opm;
@@ -188,8 +184,10 @@ BOOST_AUTO_TEST_CASE( EquilOperations ) {
}
BOOST_AUTO_TEST_CASE(RestartCWD) {
test_work_area_type * work_area = test_work_area_alloc("restart_cwd");
mkdir("simulation", 0777);
WorkArea output_area;
output_area.makeSubDir("simulation");
{
std::fstream fs;
fs.open ("simulation/CASE.DATA", std::fstream::out);
@@ -229,8 +227,6 @@ BOOST_AUTO_TEST_CASE(RestartCWD) {
Opm::InitConfig init_config(deck);
BOOST_CHECK_EQUAL(init_config.getRestartRootName(), "/abs/path/BASE");
}
test_work_area_free(work_area);
}
// --------------------------------------------------------------------