PATHS keyword has global scope.

ECLIPSE resolves path aliases defined in an included file globally, i.e.
/
|> include.inc
|-- PATHS 'alias' 'path/to/dir'
|> main.data
|-- INCLUDE 'include.inc' /
| [...]
|-- INCLUDE '$alias/file.inc' /

will resolve as 'path/to/dir/file.inc'. This behaviour is now adopted by
opm-parser.
This commit is contained in:
Jørgen Kvalsvik
2016-02-22 09:56:46 +01:00
parent 7b5bc29d81
commit 7bc3c79301
7 changed files with 39 additions and 8 deletions

View File

@@ -25,6 +25,7 @@
#include <opm/json/JsonObject.hpp>
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParserKeyword.hpp>
#include <opm/parser/eclipse/Parser/ParserRecord.hpp>
@@ -302,3 +303,8 @@ BOOST_AUTO_TEST_CASE( quoted_comments ) {
BOOST_CHECK_EQUAL( Parser::stripComments("ABC'--'DEF'--GHI") , "ABC'--'DEF'--GHI");
}
BOOST_AUTO_TEST_CASE( PATHS_has_global_scope ) {
Parser parser;
parser.newDeckFromFile( "testdata/parser/PATHSInInclude.data", ParseMode() );
BOOST_CHECK_THROW( parser.newDeckFromFile( "testdata/parser/PATHSInIncludeInvalid.data", ParseMode() ), std::runtime_error );
}