changed: use std::filesystem instead of boost::filesystem

since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.

for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
This commit is contained in:
Arne Morten Kvarving
2020-02-12 09:12:29 +01:00
parent 679c7a2a5c
commit fb75bcd4e2
38 changed files with 306 additions and 204 deletions

View File

@@ -24,7 +24,7 @@
#include <boost/test/unit_test.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/filesystem/path.hpp>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/json/JsonObject.hpp>
@@ -244,7 +244,7 @@ BOOST_AUTO_TEST_CASE(parseJSONObject_testType) {
BOOST_AUTO_TEST_CASE(Parse_fileDoesNotExist_Throws) {
boost::filesystem::path jsonFile("file/does/not/exist");
Opm::filesystem::path jsonFile("file/does/not/exist");
BOOST_CHECK_THROW( Json::JsonObject parser(jsonFile) , std::invalid_argument);
}
@@ -252,14 +252,14 @@ BOOST_AUTO_TEST_CASE(Parse_fileDoesNotExist_Throws) {
BOOST_AUTO_TEST_CASE(Parse_fileExists_OK) {
const auto arg = framework::master_test_suite().argv[1];
boost::filesystem::path jsonFile(arg);
Opm::filesystem::path jsonFile(arg);
BOOST_CHECK_NO_THROW( Json::JsonObject parser(jsonFile) );
}
BOOST_AUTO_TEST_CASE(to_string_ok) {
const auto arg = framework::master_test_suite().argv[1];
boost::filesystem::path jsonFile(arg);
Opm::filesystem::path jsonFile(arg);
Json::JsonObject parser(jsonFile);
std::string json_string =
"{\n"