mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-30 17:10:19 -05:00
* #14806 Faults: Compute unnamed fault faces in parallel and only from positive faces - A negative I or J face is the positive face of the neighbor cell with a lower index, and is already handled when that neighbor is processed. Only visit the positive faces. - Each cell only writes the fault index of its own positive faces and the opposite faces of its neighbors, so process the cells in parallel. The thread results are appended in thread order, so the fault faces keep the same order as before. * #14806 Faults: Add unit tests for parallel unnamed fault face computation Build a small in-memory grid (no file, no view) with geometric faults at every I interface, and verify that calculateFaults() finds all unnamed fault faces, keeps them ordered by native cell index (the per-thread results are appended in thread order), and separates faces touching an inactive cell into the dedicated inactive fault face list.
371 lines
16 KiB
CMake
371 lines
16 KiB
CMake
# ResInsight unit tests
|
|
|
|
if(MSVC)
|
|
# TARGET_RUNTIME_DLLS requires 3.21
|
|
cmake_minimum_required(VERSION 3.21)
|
|
endif(MSVC)
|
|
|
|
set(SOURCE_UNITTEST_FILES
|
|
${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/Ert-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigModelPaddingSettings-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigPadModel-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigSimulationInputTool-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigBoundingBoxIjk-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigContourMapGrid-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifcCommandCore-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaGrpcFieldSerialization-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifOpmFlowDeckFile-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseOutput-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifReaderOpmCommon-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseSummary-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultsData-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigEclipseCaseDataTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigEclipseCrossPlotDataExtractor-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigEclipseResultTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigEnsembleFractureStatisticsCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigMobilePoreVolumeResultCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigSgasResultCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigPorvSoilSgasResultCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigReservoir-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigMainGridFaults-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigMainGridSearchTree-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigResdataGridConverter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigGridExportAdapter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigNonUniformRefinement-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigNestedHybridGridReconstructor-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigStatisticsMath-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigWellPathIntersectionTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimHistogramDataSource-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveImpl-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RivAnnotationTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RivNamedVisualizationModels-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RivPipeGeometryGenerator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RivIjkIntersectionGeometryGenerator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RivSingleCellPartGenerator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapper-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/ScalarMapper-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/WellPathAsciiFileReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/opm-flowdiagnostics-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigContourMapPeakFinder-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/HDF5FileReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/HDF5FileWriter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigHexIntersectionTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/ObservedDataParser-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RicExpressionParser-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiuPlotUpdater-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiuQwtLinearScaleEngine-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorDescriptionMap-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/FixedWidthDataParser-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigTimeCurveHistoryMerger-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/ListKeywordsForObjectsAndFields-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyTableReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimRelocatePath-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityCondenser-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractor-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigWellPath-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/SolveSpaceSolver-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMean-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaMedianCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaFilePathTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/Intersect-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifPerforationIntervalReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimWellPathFracture-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimWellPathValve-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimWellRftPlot-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimWellTargetMapping-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimDataFilterCollection-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimFilterInViewCollection-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseMainCollection-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryTimeAxisProperties-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimDeltaSummaryEnsemble-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryEnsemble-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressAnalyzer-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaStringPool-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifWellMeasurementReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaDateStringParser-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigHexGradientTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifSurfaceImporter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifFormationNamesReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifRoffReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifRoffWriter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifRoffFileTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigStatisticsTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifThermalFractureReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifSummaryDataReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigSlice2D-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigConvexHull-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/StructGridInterface-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/opm-summary-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifEclipseTextFileReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryStringTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaVariableMapper-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifPressureDepthTextFileReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifRevealCsvSectionSummaryReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifRevealCsvSummaryReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanCsvSummaryReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigDeclineCurveCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifReaderFmuRft-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifRftSegment-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryRegressionAnalysisCurve-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCalculatedCurve-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigWellLogCurveData-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaNumericalTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/opm-import-well-data-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifInpExportTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifGridCalculationIO-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimCellFilterTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimStatisticsContourMap-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimGridCalculation-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifSummaryCalculationIO-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimEmReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimFormationNames-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifPolygonReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifParquetReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifOsduWellPathReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigVfpTables-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaResultName-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigPolygonTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimPolygonInViewCollection-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInViewCollection-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaNameUniquenessTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifVtkSurfaceImporter-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifVtkReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigFemPart-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifVtkImportUtil-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaKeyValueStore-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleImportTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifSurfio-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifRmsWellPathReader-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaAngleUtils-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaZScaleTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RicTransmissibilityCalculator-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigCompletionDataGridCell-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/cafVecIjk-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryAddressCollectionTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/../TestModels/RimMockSummaryCase.h
|
|
${CMAKE_CURRENT_LIST_DIR}/RimMockSummaryCase-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculation-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RifMultipleSummaryReaders-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationCollection-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaConnectorTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigWellTargetMappingTools-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportMswGeometryPath-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RicMswBranchBuilder-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigMswTableData-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RigAllGridCellsResultAccessor-Test.cpp
|
|
)
|
|
|
|
if(RESINSIGHT_ENABLE_GRPC)
|
|
list(APPEND SOURCE_UNITTEST_FILES
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaGrpcInterface-Test.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaGrpcWellPathService-Test.cpp
|
|
)
|
|
endif(RESINSIGHT_ENABLE_GRPC)
|
|
|
|
# Obsolete test
|
|
if(RESINSIGHT_USE_ODB_API_OBSOLETE)
|
|
list(APPEND SOURCE_UNITTEST_FILES
|
|
${CMAKE_CURRENT_LIST_DIR}/RifOdbReader-Test.cpp
|
|
)
|
|
endif(RESINSIGHT_USE_ODB_API_OBSOLETE)
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
googletest
|
|
GIT_REPOSITORY https://github.com/google/googletest.git
|
|
GIT_TAG v1.15.2
|
|
)
|
|
|
|
set(BUILD_GMOCK
|
|
OFF
|
|
CACHE BOOL "" FORCE
|
|
)
|
|
set(BUILD_GTEST
|
|
ON
|
|
CACHE BOOL "" FORCE
|
|
)
|
|
set(INSTALL_GTEST
|
|
OFF
|
|
CACHE BOOL "" FORCE
|
|
)
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
# ##############################################################################
|
|
# Copy required Dll/.so to output folder
|
|
# ##############################################################################
|
|
|
|
# create an empty library target that will be used to copy files to the build
|
|
# folder
|
|
add_library(ResInsightDummyTestTarget EXCLUDE_FROM_ALL empty.cpp)
|
|
set_property(
|
|
TARGET ResInsightDummyTestTarget PROPERTY FOLDER "FileCopyTargetsTest"
|
|
)
|
|
|
|
# Keep the test executable out of the shared build root. The POST_BUILD step
|
|
# below copies the Qt runtime DLLs next to the executable, and the build root
|
|
# has ResInsight.exe running out of it during Python code generation with those
|
|
# same DLLs loaded. Overwriting a mapped DLL is a sharing violation on Windows,
|
|
# and nothing orders the two build edges relative to each other.
|
|
set(RESINSIGHT_TESTS_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
# create a custom target that copies the files to the test output folder
|
|
list(
|
|
APPEND
|
|
copyCommands
|
|
COMMAND
|
|
${CMAKE_COMMAND}
|
|
-E
|
|
make_directory
|
|
${RESINSIGHT_TESTS_OUTPUT_DIRECTORY}
|
|
)
|
|
foreach(riFileName ${RI_FILENAMES})
|
|
list(
|
|
APPEND
|
|
copyCommands
|
|
COMMAND
|
|
${CMAKE_COMMAND}
|
|
-E
|
|
copy_if_different
|
|
${riFileName}
|
|
${RESINSIGHT_TESTS_OUTPUT_DIRECTORY}
|
|
)
|
|
endforeach()
|
|
add_custom_target(PreBuildFileCopyTest ${copyCommands})
|
|
set_property(TARGET PreBuildFileCopyTest PROPERTY FOLDER "FileCopyTargetsTest")
|
|
|
|
qt_add_executable(ResInsight-tests ${SOURCE_UNITTEST_FILES} main.cpp)
|
|
|
|
# Scope USE_HDF5 and its include dir to the 3 test files that need them, to
|
|
# avoid a full rebuild on toggle.
|
|
if(RESINSIGHT_FOUND_HDF5)
|
|
set(RI_HDF5_TEST_FILES
|
|
${CMAKE_CURRENT_SOURCE_DIR}/HDF5FileReader-Test.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/HDF5FileWriter-Test.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/RimEmReader-Test.cpp
|
|
)
|
|
set_source_files_properties(
|
|
${RI_HDF5_TEST_FILES} PROPERTIES COMPILE_DEFINITIONS
|
|
"USE_HDF5;H5_BUILT_AS_DYNAMIC_LIB"
|
|
)
|
|
if(MSVC)
|
|
set_source_files_properties(
|
|
${RI_HDF5_TEST_FILES} PROPERTIES INCLUDE_DIRECTORIES
|
|
${RESINSIGHT_HDF5_DIR}/include
|
|
)
|
|
else()
|
|
set_source_files_properties(
|
|
${RI_HDF5_TEST_FILES} PROPERTIES INCLUDE_DIRECTORIES
|
|
"${HDF5_INCLUDE_DIRS}"
|
|
)
|
|
endif()
|
|
endif()
|
|
|
|
# Make ResInsight-tests depend on the prebuild target.
|
|
add_dependencies(ResInsight-tests PreBuildFileCopyTest)
|
|
|
|
set_target_properties(
|
|
ResInsight-tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
${RESINSIGHT_TESTS_OUTPUT_DIRECTORY}
|
|
)
|
|
|
|
configure_file(
|
|
${CMAKE_CURRENT_LIST_DIR}/RiaTestDataDirectory.h.cmake
|
|
${CMAKE_BINARY_DIR}/Generated/RiaTestDataDirectory.h
|
|
)
|
|
|
|
target_include_directories(
|
|
ResInsight-tests
|
|
PUBLIC ${CMAKE_BINARY_DIR}/Generated
|
|
"$<TARGET_PROPERTY:ApplicationLibCode,PUBLIC_INCLUDE_DIRECTORIES>"
|
|
${PROJECT_SOURCE_DIR}/Commands
|
|
${PROJECT_SOURCE_DIR}/Commands/CompletionExportCommands
|
|
${CMAKE_CURRENT_LIST_DIR}/../TestModels
|
|
)
|
|
|
|
target_compile_features(ResInsight-tests PRIVATE cxx_std_20)
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
find_package(Threads REQUIRED)
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
list(APPEND THIRD_PARTY_LIBRARIES rt atomic)
|
|
endif()
|
|
|
|
set(LINK_LIBRARIES
|
|
${THIRD_PARTY_LIBRARIES}
|
|
${OPENGL_LIBRARIES}
|
|
${QT_LIBRARIES}
|
|
${OPM_LIBRARIES}
|
|
${APP_FWK_LIBRARIES}
|
|
${VIZ_FWK_LIBRARIES}
|
|
ApplicationLibCode
|
|
Commands
|
|
RigGeoMechDataModel
|
|
RifGeoMechFileInterface
|
|
)
|
|
|
|
if(RESINSIGHT_ENABLE_GRPC)
|
|
list(APPEND LINK_LIBRARIES GrpcInterface)
|
|
endif()
|
|
|
|
if(RESINSIGHT_USE_ODB_API)
|
|
list(APPEND LINK_LIBRARIES RifOdbReader)
|
|
endif()
|
|
|
|
target_link_libraries(ResInsight-tests PUBLIC ${LINK_LIBRARIES} GTest::gtest)
|
|
|
|
if(MSVC)
|
|
add_custom_command(
|
|
TARGET ResInsight-tests
|
|
POST_BUILD
|
|
COMMAND
|
|
${CMAKE_COMMAND} -E copy_if_different
|
|
$<TARGET_RUNTIME_DLLS:ResInsight-tests>
|
|
$<TARGET_FILE_DIR:ResInsight-tests>
|
|
COMMAND_EXPAND_LISTS
|
|
)
|
|
|
|
set_target_properties(ResInsight-tests PROPERTIES COMPILE_FLAGS "/wd4190")
|
|
endif(MSVC)
|
|
|
|
add_test(NAME ResInsight-tests COMMAND ResInsight-tests)
|