From 9d1f5e2e1eb1276e5ebcc1c3903c23dff0e36fa9 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Sat, 16 Jan 2021 14:23:07 +0100
Subject: [PATCH] [co2][test] Cleanup CMakeLists.txt

---
 .../co2/implicit/CMakeLists.txt               | 37 +++++--------------
 1 file changed, 10 insertions(+), 27 deletions(-)

diff --git a/test/porousmediumflow/co2/implicit/CMakeLists.txt b/test/porousmediumflow/co2/implicit/CMakeLists.txt
index 1736ec41a1..cf1b1c7b4e 100644
--- a/test/porousmediumflow/co2/implicit/CMakeLists.txt
+++ b/test/porousmediumflow/co2/implicit/CMakeLists.txt
@@ -5,15 +5,10 @@ dune_symlink_to_source_files(FILES grids)
 # Ignore the porosity for all box models since it is defined element-wise in these test
 # but the default 2p2c implementation outputs porosity per vertex.
 # Depending on the order of the elements, the porosity would differ in these cases.
-add_executable(test_co2_box EXCLUDE_FROM_ALL main.cc)
-target_compile_definitions(test_co2_box PUBLIC TYPETAG=HeterogeneousBox )
 
-add_executable(test_co2_tpfa EXCLUDE_FROM_ALL main.cc)
-target_compile_definitions(test_co2_tpfa PUBLIC TYPETAG=HeterogeneousCCTpfa )
-
-# sequential box
-dumux_add_test(NAME test_co2_box_sequential
-               TARGET test_co2_box
+dumux_add_test(NAME test_co2_box
+               SOURCES main.cc
+               COMPILE_DEFINITIONS TYPETAG=HeterogeneousBox
                LABELS porousmediumflow co2
                CMAKE_GUARD "( dune-alugrid_FOUND )"
                COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
@@ -23,10 +18,9 @@ dumux_add_test(NAME test_co2_box_sequential
                         --command "${CMAKE_CURRENT_BINARY_DIR}/test_co2_box params.input -Problem.Name test_co2_box"
                         --zeroThreshold {"porosity":1})
 
-# sequential tpfa
-dumux_add_test(NAME test_co2_tpfa_sequential
+dumux_add_test(NAME test_co2_tpfa
                LABELS porousmediumflow co2
-               TARGET test_co2_tpfa
+               SOURCES main.cc
                COMPILE_DEFINITIONS TYPETAG=HeterogeneousCCTpfa
                CMAKE_GUARD "( dune-alugrid_FOUND )"
                COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
@@ -35,7 +29,6 @@ dumux_add_test(NAME test_co2_tpfa_sequential
                                 ${CMAKE_CURRENT_BINARY_DIR}/test_co2_tpfa-00028.vtu
                         --command "${CMAKE_CURRENT_BINARY_DIR}/test_co2_tpfa params.input -Problem.Name test_co2_tpfa")
 
-# parallel box
 dumux_add_test(NAME test_co2_box_parallel
                TARGET test_co2_box
                LABELS porousmediumflow co2 parallel
@@ -47,7 +40,6 @@ dumux_add_test(NAME test_co2_box_parallel
                                 ${CMAKE_CURRENT_BINARY_DIR}/s0002-test_co2_box_parallel-00028.pvtu
                         --command "${MPIEXEC} -np 2 ${CMAKE_CURRENT_BINARY_DIR}/test_co2_box params.input -Problem.Name test_co2_box_parallel")
 
-# parallel tpfa
 dumux_add_test(NAME test_co2_tpfa_parallel
                TARGET test_co2_tpfa
                LABELS porousmediumflow co2 parallel
@@ -59,16 +51,9 @@ dumux_add_test(NAME test_co2_tpfa_parallel
                                 ${CMAKE_CURRENT_BINARY_DIR}/s0002-test_co2_tpfa_parallel-00028.pvtu
                         --command "${MPIEXEC} -np 2 ${CMAKE_CURRENT_BINARY_DIR}/test_co2_tpfa params.input -Problem.Name test_co2_tpfa_parallel")
 
-# build target for the CO2 non-isothermal test problem
-add_executable(test_co2ni_box EXCLUDE_FROM_ALL main.cc)
-target_compile_definitions(test_co2ni_box PUBLIC TYPETAG=HeterogeneousNIBox PUBLIC ISOTHERMAL=0 )
 
-add_executable(test_co2ni_tpfa EXCLUDE_FROM_ALL main.cc)
-target_compile_definitions(test_co2ni_tpfa PUBLIC TYPETAG=HeterogeneousNICCTpfa PUBLIC ISOTHERMAL=0 )
-
-# sequential box
-dumux_add_test(NAME test_co2ni_box_sequential
-               TARGET test_co2ni_box
+dumux_add_test(NAME test_co2ni_box
+               SOURCES main.cc
                LABELS porousmediumflow co2 co2ni
                COMPILE_DEFINITIONS TYPETAG=HeterogeneousNIBox ISOTHERMAL=0
                CMAKE_GUARD "( dune-alugrid_FOUND )"
@@ -79,10 +64,10 @@ dumux_add_test(NAME test_co2ni_box_sequential
                         --command "${CMAKE_CURRENT_BINARY_DIR}/test_co2ni_box paramsni.input -Problem.Name test_co2ni_box"
                         --zeroThreshold {"porosity":1})
 
-# sequential tpfa
-dumux_add_test(NAME test_co2ni_tpfa_sequential
-               TARGET test_co2ni_tpfa
+dumux_add_test(NAME test_co2ni_tpfa
+               SOURCES main.cc
                LABELS porousmediumflow co2 co2ni
+               COMPILE_DEFINITIONS TYPETAG=HeterogeneousNICCTpfa PUBLIC ISOTHERMAL=0
                CMAKE_GUARD "( dune-alugrid_FOUND )"
                COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
                CMD_ARGS --script fuzzy
@@ -90,7 +75,6 @@ dumux_add_test(NAME test_co2ni_tpfa_sequential
                                 ${CMAKE_CURRENT_BINARY_DIR}/test_co2ni_tpfa-00028.vtu
                         --command "${CMAKE_CURRENT_BINARY_DIR}/test_co2ni_tpfa paramsni.input -Problem.Name test_co2ni_tpfa")
 
-# parallel box
 dumux_add_test(NAME test_co2ni_box_parallel
                TARGET test_co2ni_box
                LABELS porousmediumflow co2 co2ni parallel
@@ -102,7 +86,6 @@ dumux_add_test(NAME test_co2ni_box_parallel
                                 ${CMAKE_CURRENT_BINARY_DIR}/s0002-test_co2ni_box_parallel-00028.pvtu
                         --command "${MPIEXEC} -np 2 ${CMAKE_CURRENT_BINARY_DIR}/test_co2ni_box paramsni.input -Problem.Name test_co2ni_box_parallel")
 
-# parallel tpfa
 dumux_add_test(NAME test_co2ni_tpfa_parallel
                TARGET test_co2ni_tpfa
                LABELS porousmediumflow co2 co2ni parallel
-- 
GitLab