From 40dafc16245d43cab3631e3fc7cd0ad3581e1f6c Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Mon, 24 Jun 2024 20:25:19 +0200 Subject: [PATCH] Add unit test template combination --- CMakeLists.txt | 3 ++- unitTests/CMakeLists.txt | 5 ++--- unitTests/Combination.C | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 unitTests/Combination.C diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f1a7ea61..09b835399 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ include(cmake/ginkgo.cmake) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -O0 -ggdb") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} \ - -Wall -Wpedantic -Wextra -march=native -fopenmp -Wno-undefined-var-template" + -Wall -Wpedantic -Wextra -Wno-undefined-var-template" ) if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") @@ -116,6 +116,7 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} \ --coverage\ + --fopenmp \ -fprofile-arcs \ -ggdb3 \ ") diff --git a/unitTests/CMakeLists.txt b/unitTests/CMakeLists.txt index bbec72bee..999aa037b 100644 --- a/unitTests/CMakeLists.txt +++ b/unitTests/CMakeLists.txt @@ -31,10 +31,9 @@ macro(ogl_unit_test TEST FILE) target_link_libraries( ${TEST} PUBLIC GTest::gtest_main - $ENV{FOAM_LIBBIN}/libOpenFOAM.so - $ENV{FOAM_LIBBIN}/libfiniteVolume.so - $ENV{FOAM_LIBBIN}/$ENV{FOAM_MPI}/libPstream.so + OpenFOAM OGL + Ginkgo::ginkgo # MPI::MPI_CXX ${CMAKE_DL_LIBS}) diff --git a/unitTests/Combination.C b/unitTests/Combination.C new file mode 100644 index 000000000..651f55de9 --- /dev/null +++ b/unitTests/Combination.C @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2024 OGL authors +// +// SPDX-License-Identifier: GPL-3.0-or-later + + +#include "fvCFD.H" +#include "MatrixWrapper/Combination/Combination.H" +#include + + +TEST(Combination, CanCreateCombination) +{ + auto cmb = Combination::create(this->exec); + + ASSERT_EQ(cmb->get_size(), gko::dim<2>(0, 0)); + ASSERT_EQ(cmb->get_coefficients().size(), 0); + ASSERT_EQ(cmb->get_operators().size(), 0); +}