add imported parser/output sources to build system

use -DENABLE_ECL_INPUT=0 to disable input (and output) support
use -DENABLE_ECL_OUTPUT=0 to disable output support

both default to on
This commit is contained in:
Arne Morten Kvarving
2018-03-05 12:46:51 +01:00
parent dbba64e5c3
commit 932cece7d3
9 changed files with 521 additions and 58 deletions

View File

@@ -1,5 +1,5 @@
# Libs to link tests against
set(TEST_LIBS opmparser ecl Boost::unit_test_framework)
set(TEST_LIBS opmcommon ecl Boost::unit_test_framework)
set(EXTRA_TESTS)
# Generated source, needs to be here
@@ -11,23 +11,23 @@ list(APPEND EXTRA_TESTS inlinekw)
# Extra compile definitions and extra parameters
include(cmake/Modules/CheckCaseSensitiveFileSystem.cmake)
set(_testdir ${PROJECT_SOURCE_DIR}/lib/eclipse/tests/data)
set(_testdir ${PROJECT_SOURCE_DIR}/tests/parser/data)
opm_add_test(LoaderTest
SOURCES lib/eclipse/tests/KeywordLoaderTests.cpp
lib/eclipse/Generator/KeywordLoader.cpp
SOURCES tests/parser/KeywordLoaderTests.cpp
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/parser/keyword-generator/)
list(APPEND EXTRA_TESTS LoaderTest)
opm_add_test(ParserTests
SOURCES lib/eclipse/tests/ParserTests.cpp
SOURCES tests/parser/ParserTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/)
list(APPEND EXTRA_TESTS ParserTests)
opm_add_test(ParserIncludeTests
SOURCES lib/eclipse/tests/ParserIncludeTests.cpp
SOURCES tests/parser/ParserIncludeTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/parser/)
target_compile_definitions(ParserIncludeTests PRIVATE
@@ -35,13 +35,13 @@ target_compile_definitions(ParserIncludeTests PRIVATE
list(APPEND EXTRA_TESTS ParserIncludeTests)
opm_add_test(PvtxTableTests
SOURCES lib/eclipse/tests/PvtxTableTests.cpp
SOURCES tests/parser/PvtxTableTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS PvtxTableTests)
opm_add_test(EclipseStateTests
SOURCES lib/eclipse/tests/EclipseStateTests.cpp
SOURCES tests/parser/EclipseStateTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS EclipseStateTests)
@@ -62,7 +62,7 @@ foreach (test BoxTest
TransMultIntegrationTests)
opm_add_test(${test}
SOURCES lib/eclipse/tests/integration/${test}.cpp
SOURCES tests/parser/integration/${test}.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/integration_tests/)
list(APPEND EXTRA_TESTS ${test})
@@ -71,7 +71,7 @@ endforeach ()
# opm-data dependent tests
if(HAVE_OPM_DATA)
opm_add_test(parse_write ONLY_COMPILE
SOURCES lib/eclipse/tests/integration/parse_write.cpp
SOURCES tests/parser/integration/parse_write.cpp
LIBRARIES ${TEST_LIBS})
list(APPEND EXTRA_TESTS parse_write)
foreach (deck ${OPM_DATA_ROOT}/norne/NORNE_ATW2013.DATA
@@ -102,7 +102,7 @@ endif()
# JSON tests
opm_add_test(jsonTests
SOURCES lib/json/tests/jsonTests.cpp
SOURCES tests/json/jsonTests.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${PROJECT_SOURCE_DIR}/lib/json/tests/example1.json)
TEST_ARGS ${PROJECT_SOURCE_DIR}/tests/json/example1.json)
list(APPEND EXTRA_TESTS jsonTests)