Skip to content

Commit

Permalink
Add unit test template combination
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Jun 24, 2024
1 parent fc66363 commit 40dafc1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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 \
")
Expand Down
5 changes: 2 additions & 3 deletions unitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
18 changes: 18 additions & 0 deletions unitTests/Combination.C
Original file line number Diff line number Diff line change
@@ -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 <gtest/gtest.h>


TEST(Combination, CanCreateCombination)
{
auto cmb = Combination<double, int, gko::matrix::Coo>::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);
}

0 comments on commit 40dafc1

Please sign in to comment.