Commit Graph

238 Commits

Author SHA1 Message Date
Joakim Hove
81b71d5d08 Removed EclipseGrid member from Schedule class. 2016-09-12 21:42:34 +02:00
Jørgen Kvalsvik
ca2985d5a0 Fix warnings in ParserTests 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
d85bbf9f2b Fix warnings in ParserKeywordTests 2016-07-13 23:40:09 +02:00
Joakim Hove
f2e94061d8 Added Json config for new keywords. 2016-07-13 14:56:15 +02:00
Jørgen Kvalsvik
3696b750cd Remove opm-common dependency
Severs the code dependency on opm-commmon. There was no actual
functional dependency here, with the exception of some enable/disable
warning headers. To properly make opm-parser a stand-alone module the
usage of these headers have been removed and the dependency on
opm-common is gone.
2016-07-08 15:53:40 +02:00
Pål Grønås Drange
5b3eaada22 EclipseState demands full deck now, so added D(X|Y|Z) and TOPS to tests 2016-06-21 15:55:04 +02:00
Joakim Hove
10bf441076 Added ParseContext::PARSE_MISSING_INCLUDE 2016-06-15 17:34:44 +02:00
Joakim Hove
0f53084015 Merge pull request #827 from joakim-hove/check-symlinks
Check for symlink() and compile test conditionally
2016-06-15 15:19:29 +02:00
Joakim Hove
8e9dce4bd8 Merge pull request #839 from joakim-hove/ignore-operate
Added keyword OPERATE.
2016-06-15 09:10:26 +02:00
Jørgen Kvalsvik
f56a2d61d0 Strip commas from the input deck
Some decks use comma to separate items in a record, but the comma adds
no extra information and is essentially ignored. Post-process the file
after cleaning it and replace all commas with whitespace.

Considering the record "foo bar , , , baz" / baz will silently be moved
to the third item, but handling that situation is a **lot** more
difficult and time consuming and not worth the effort for now.
Additionally, we have yet to receive decks that fail in such a manner,
nor are we sure if it is even a valid record in Eclipse.
2016-06-14 12:57:05 +02:00
Joakim Hove
8cfb73d991 Added keyword OPERATE. 2016-06-14 12:29:31 +02:00
Joakim Hove
774c36c4a9 Check for symlink() and compile test conditionally 2016-06-11 07:45:24 +02:00
Liu Ming
5d631d7dd2 change Prtinfo to Note. 2016-06-08 09:12:58 +02:00
Liu Ming
dea35c4c34 Add Prtinfo message type allows messages go into print file. 2016-06-07 14:09:35 +02:00
Jørgen Kvalsvik
744d2ee773 Remove IOConfig use in Schedule 2016-06-06 11:04:27 +02:00
Magne Sjaastad
4186ce5a11 VS2015: Test for MSVC when guarding compiler flags 2016-05-25 10:39:19 +02:00
Liu Ming
14c33394f4 add MessageContainer argument for logging messages. 2016-05-14 08:42:40 +02:00
Jørgen Kvalsvik
1f2c2ba98d Name cases where TITLE is unset
When the TITLE keyword was present in the deck, but no parameter was
given the parser would consume the next keyword as the simulation TITLE.
Override this by writing a default TITLE if it's unset.
2016-05-03 15:42:30 +02:00
Jørgen Kvalsvik
8a4eb5279c Splitting records with string_view; test updates
The splitting of RawRecords into individual symbols uses string_view.
Also updates tests since RawRecord now assumes that the record string it
receives is complete and does *not* contain the terminating slash.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
6b64796d49 Add char* constructor to string_view
Mostly relevant for testing, this enables string_view to work as
expected with string literals.
2016-05-03 09:16:28 +02:00
Kjell W. Kongsvik
1640ad0826 Removed meaningless "path" paramater in tests
This parameter will be used in a more meaningful way
2016-04-28 13:45:08 +02:00
Joakim Hove
001e2a7ad0 Merge pull request #759 from pgdr/prop-test-lean-grid
Testing Eclipse3DProperties API
2016-04-13 14:44:31 +02:00
Atgeirr Flø Rasmussen
0104055076 Suppress Boost warnings. 2016-04-13 13:04:33 +02:00
Pål Grønås Drange
4e97aab8aa Testing Eclipse3DProperties API
* Added Eclipse3DPropertiesTests
* Refactored tests to use Eclipse3DProperties instead of EclipseState
* Added unsigned literal to MessageContainerTest
2016-04-13 12:44:07 +02:00
Joakim Hove
9c6a120414 Merge pull request #757 from qilicun/append-messagecontainer
Add appendMessages() function.
2016-04-13 09:57:27 +02:00
Liu Ming
c782068baf add size() function. 2016-04-13 15:07:12 +08:00
Liu Ming
72dd934c71 add test for appendMessages function. 2016-04-13 14:04:21 +08:00
Joakim Hove
49a1c17eb8 Removed signed / unsigned comparison warning. 2016-04-12 13:59:02 +02:00
Jørgen Kvalsvik
0d24ac2d4a Store Location::lineno as size_t
By storing it as size_t we explicitly disallow negative line numbers,
and keep 0 as an error/empty/undefined location.

A small problem with this is that MessageContainer.error and friends
still accept negative numbers (often without warning) via size_t
implicit conversion and wrap-around.
2016-04-06 11:41:22 +02:00
Jørgen Kvalsvik
f3bef79562 MessageContainer::const_iterator bound
While the implementation is a simple alias to
std::vector<Message>::const_iterator, it enablese generic lookup of the
iterator type at compile time, and enables us to effortlessly change the
underlying implementation later.
2016-04-06 10:38:19 +02:00
Jørgen Kvalsvik
6c8487ea07 Message::location uses automatic members
By supporting operator bool() we get the same existence checking
capabilities as the unique_ptr implementations, without the hurdles of
non-copyability and manual heap allocation.
2016-04-06 10:38:13 +02:00
chflo
8ee79e7be6 Support symlinks: Added test 2016-04-01 14:28:26 +02:00
Joakim Hove
92ba3df9ab Merge pull request #729 from qilicun/add_message_container
Add message container
2016-03-29 08:49:49 +02:00
Liu Ming
1f44ade6c7 Add range based test. 2016-03-29 10:21:10 +08:00
Liu Ming
aea8d7a5bf test iterator. 2016-03-28 08:52:56 +08:00
Liu Ming
9828cdc1d9 fix copy right. 2016-03-25 11:21:43 +08:00
Liu Ming
b53d0909ba add tests for message container. 2016-03-25 10:55:22 +08:00
Jørgen Kvalsvik
0da5cadc75 RawRecords auto store, strings moved to RawRecord
The accumulated strings are moved into RawRecords, which reduces
execution time (rough measurements indicates 4-8%). To facilitate this,
RawRecords are stored directly in the vector in favour of via
shared_ptrs.
2016-03-22 08:58:48 +01:00
Joakim Hove
f0158f6ca3 Merge pull request #718 from jokva/fix-uninitialised-values
Initialisation and memory errors fixed
2016-03-17 13:56:48 +01:00
Liu Ming
25acd89325 rename the last files. 2016-03-17 08:42:46 +08:00
Liu Ming
705a9dc168 rename ParseMode as ParseContex in Parser folder. 2016-03-16 16:34:58 +08:00
Jørgen Kvalsvik
47ca6d31cc Remove unused dropParserKeyword
This method is not used at all, but creates noise in tests and is broken
(iterator invalidation).
2016-03-15 15:14:10 +01:00
Jørgen Kvalsvik
7bc3c79301 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.
2016-02-22 10:16:12 +01:00
Jørgen Kvalsvik
78e1ab9db5 Parser stores keywords as unique_ptr
Removes shared_ptr< ParserKeyword > exchange in Parser interface and
replaces it with unique_ptr storage and raw pointers for return values.
This has some implications:

* addParserKeyword() no longer takes shared_ptr<>, but unique_ptr&&
  addParserKeyword has been modified to create unique_ptr instead of
  shared_ptr.

* generated-source/ParserKeyword* no longer use make_shared which had a
  -massive- impact on compile times, which are now more-or-less
  trivialised (on my machine: 7.5s -> 1s per file). This because the
  compiler no longer generates a bunch of forwarding make_shared
  instances of subclasses that are immediately thrown away, but rather
  uses an inline make_unique that instantiates the -parent- class
  unique_ptr.
2016-02-19 14:19:41 +01:00
Jørgen Kvalsvik
a187d58502 Removes unused function in ParserTests 2016-02-19 14:04:17 +01:00
Jørgen Kvalsvik
f0ae5db131 opm-parser adoption of Deck automatic ownership
Since the Deck* family of classes have changed their interfaces to no
longer use shared_ptr, a lot of code broke. This patch fixes all
problems in tests, other signatures and accesses to now use the new Deck
interfaces.
2016-02-18 13:27:24 +01:00
Jørgen Kvalsvik
8b12fda9c3 Remove unused FloatItem classes
ParserItemFloat and DeckItemFloat is never used within the project.
2016-02-03 12:22:41 +01:00
Jørgen Kvalsvik
4b98943665 Replaces unecessary header includes with fwd decls
Every header is self-contained and includes only what it must to
function, relying on users include what they need in source files,
adopting a pay-what-you-use model (in particular for internal
dependencies).
2016-01-26 13:23:22 +01:00
Jørgen Kvalsvik
04900a4bb6 ParserKeywords.hpp -> ParserKeywordsX.hpp
To reduce compiler stress and be more explicit w.r.t. dependencies, all
files now includes only the keywords they need, instead of the
collection of all files.
2016-01-21 09:25:58 +01:00
Joakim Hove
2b3e1c381a Added 'minideck' to Schedule object. 2015-11-09 12:05:10 +01:00