Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-grid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-grid
Commits
5f8f053d
Commit
5f8f053d
authored
9 years ago
by
Dominic Kempf
Committed by
Christian Engwer
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] Adapt the yaspgrid test subdirectory to dune_add_test
parent
47887268
No related branches found
No related tags found
1 merge request
!3
Split YaspGrid tests into more tests and introduce parallel testing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/grid/test/yasp/CMakeLists.txt
+65
-72
65 additions, 72 deletions
dune/grid/test/yasp/CMakeLists.txt
with
65 additions
and
72 deletions
dune/grid/test/yasp/CMakeLists.txt
+
65
−
72
View file @
5f8f053d
# Add all tests without deprecations
dune_add_test
(
NAME test-yaspgrid-backuprestore-equidistant-without-deprecations
SOURCES test-yaspgrid-backuprestore-equidistant.cc
MPI_RANKS 1 2
COMPILE_DEFINITIONS DISABLE_DEPRECATED_METHOD_CHECK=1
COMPILE_FLAGS -Wall -Werror
)
# add test include property manually because the folder is not called "test"
set_property
(
DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
PROPERTY TEST_INCLUDE_FILE
${
CMAKE_CURRENT_BINARY_DIR
}
/BuildTests.cmake
)
dune_add_test
(
NAME test-yaspgrid-backuprestore-equidistantoffset-without-deprecations
SOURCES test-yaspgrid-backuprestore-equidistantoffset.cc
MPI_RANKS 1 2
COMPILE_DEFINITIONS DISABLE_DEPRECATED_METHOD_CHECK=1
COMPILE_FLAGS -Wall -Werror
)
set
(
TESTS
test-yaspgrid-backuprestore-equidistant
test-yaspgrid-backuprestore-equidistantoffset
test-yaspgrid-backuprestore-tensor
test-yaspgrid-tensorgridfactory
test-yaspgrid-yaspfactory-1d
test-yaspgrid-yaspfactory-2d
test-yaspgrid-yaspfactory-3d
)
dune_add_test
(
NAME test-yaspgrid-backuprestore-tensor-without-deprecations
SOURCES test-yaspgrid-backuprestore-tensor.cc
MPI_RANKS 1 2
COMPILE_DEFINITIONS DISABLE_DEPRECATED_METHOD_CHECK=1
COMPILE_FLAGS -Wall -Werror
)
# Add tests to test target
add_directory_test_target
(
_test_target
)
dune_add_test
(
NAME test-yaspgrid-tensorgridfactory-without-deprecations
SOURCES test-yaspgrid-tensorgridfactory.cc
MPI_RANKS 1 2
COMPILE_DEFINITIONS DISABLE_DEPRECATED_METHOD_CHECK=1
COMPILE_FLAGS -Wall -Werror
)
# Add all tests, do not check deprecation
foreach
(
_test
${
TESTS
}
)
add_executable
(
${
_test
}
EXCLUDE_FROM_ALL
${
_test
}
.cc
)
add_dune_mpi_flags
(
${
_test
}
)
dune_add_test
(
NAME test-yaspgrid-yaspfactory-1d-without-deprecations
SOURCES test-yaspgrid-yaspfactory-1d.cc
MPI_RANKS 1 2
COMPILE_DEFINITIONS DISABLE_DEPRECATED_METHOD_CHECK=1
COMPILE_FLAGS -Wall -Werror
)
target_compile_definitions
(
${
_test
}
PUBLIC
DISABLE_DEPRECATED_METHOD_CHECK=1
)
target_compile_options
(
${
_test
}
PUBLIC
-Wall
-Werror
)
dune_add_test
(
NAME test-yaspgrid-yaspfactory-2d-without-deprecations
SOURCES test-yaspgrid-yaspfactory-2d.cc
MPI_RANKS 1 2
COMPILE_DEFINITIONS DISABLE_DEPRECATED_METHOD_CHECK=1
COMPILE_FLAGS -Wall -Werror
)
target_link_libraries
(
${
_test
}
"dunegrid"
${
DUNE_LIBS
}
)
add_test
(
${
_test
}
${
_test
}
)
add_dependencies
(
${
_test_target
}
${
_test
}
)
endforeach
(
_test
${
TESTS
}
)
dune_add_test
(
NAME test-yaspgrid-yaspfactory-3d-without-deprecations
SOURCES test-yaspgrid-yaspfactory-3d.cc
MPI_RANKS 1 2
COMPILE_DEFINITIONS DISABLE_DEPRECATED_METHOD_CHECK=1
COMPILE_FLAGS -Wall -Werror
)
# Add all tests again, this time with deprecation check
foreach
(
_test
${
TESTS
}
)
add_executable
(
${
_test
}
_dep EXCLUDE_FROM_ALL
${
_test
}
.cc
)
add_dune_mpi_flags
(
${
_test
}
_dep
)
# Add all tests with deprecations!
dune_add_test
(
NAME test-yaspgrid-backuprestore-equidistant-with-deprecations
SOURCES test-yaspgrid-backuprestore-equidistant.cc
MPI_RANKS 1 2
COMPILE_FLAGS -Wall -Werror -Wno-deprecated-declarations
)
target_compile_options
(
${
_test
}
_dep
PUBLIC
-Wall
-Wno-deprecated-declarations
-Werror
)
dune_add_test
(
NAME test-yaspgrid-backuprestore-equidistantoffset-with-deprecations
SOURCES test-yaspgrid-backuprestore-equidistantoffset.cc
MPI_RANKS 1 2
COMPILE_FLAGS -Wall -Werror -Wno-deprecated-declarations
)
target_link_libraries
(
${
_test
}
_dep
"dunegrid"
${
DUNE_LIBS
}
)
add_test
(
${
_test
}
_dep
${
_test
}
_dep
)
add_dependencies
(
${
_test_target
}
${
_test
}
_dep
)
endforeach
(
_test
${
TESTS
}
)
dune_add_test
(
NAME test-yaspgrid-backuprestore-tensor-with-deprecations
SOURCES test-yaspgrid-backuprestore-tensor.cc
MPI_RANKS 1 2
COMPILE_FLAGS -Wall -Werror -Wno-deprecated-declarations
)
dune_add_test
(
NAME test-yaspgrid-tensorgridfactory-with-deprecations
SOURCES test-yaspgrid-tensorgridfactory.cc
MPI_RANKS 1 2
COMPILE_FLAGS -Wall -Werror -Wno-deprecated-declarations
)
# If we have MPI, include parallel tests
if
(
MPI_FOUND
)
dune_add_test
(
NAME test-yaspgrid-yaspfactory-1d-with-deprecations
SOURCES test-yaspgrid-yaspfactory-1d.cc
MPI_RANKS 1 2
COMPILE_FLAGS -Wall -Werror -Wno-deprecated-declarations
)
set
(
TESTS_PARALLEL
test-yaspgrid-backuprestore
test-yaspgrid-tensorgridfactory
test-yaspgrid-yaspfactory-1d
test-yaspgrid-yaspfactory-2d
test-yaspgrid-yaspfactory-3d
)
dune_add_test
(
NAME test-yaspgrid-yaspfactory-2d-with-deprecations
SOURCES test-yaspgrid-yaspfactory-2d.cc
MPI_RANKS 1 2
COMPILE_FLAGS -Wall -Werror -Wno-deprecated-declarations
)
# Create tests with mpi command and add them to the test target
foreach
(
_test
${
TESTS_PARALLEL
}
)
add_test
(
NAME
${
_test
}
_parallel
COMMAND
${
MPIEXEC
}
${
MPIEXEC_NUMPROC_FLAG
}
"2"
${
_test
}
)
add_dependencies
(
${
_test_target
}
${
_test
}
_parallel
)
endforeach
(
_test
${
TESTS_PARALLEL
}
)
endif
(
MPI_FOUND
)
set
(
SOURCES
test-yaspgrid-backuprestore.cc
test-yaspgrid-tensorgridfactory.cc
test-yaspgrid-yaspfactory-1d.cc
test-yaspgrid-yaspfactory-2d.cc
test-yaspgrid-yaspfactory-3d.cc
test-yaspgrid.hh
)
install
(
FILES
${
SOURCES
}
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dune/grid/test
)
dune_add_test
(
NAME test-yaspgrid-yaspfactory-3d-with-deprecations
SOURCES test-yaspgrid-yaspfactory-3d.cc
MPI_RANKS 1 2
COMPILE_FLAGS -Wall -Werror -Wno-deprecated-declarations
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment