From 3170b6781fe194f0508376933b33ba42d8405045 Mon Sep 17 00:00:00 2001 From: Mikolaj-A-Kowalski Date: Mon, 21 Aug 2023 18:29:36 +0200 Subject: [PATCH] Supress unused variable warning due to pFUnit bug --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23b4d7122..12f844370 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,6 +166,11 @@ if(BUILD_TESTS) LINK_LIBRARIES scone ${LAPACK_LIBRARIES} ) + # pFUnit may have a bug which causes a unused variable `class(Test), allocatable :: t` be + # present if the suite contains only a TestCase and its methods + # We need to suppress this warning for clarity + target_compile_options(unitTests PRIVATE "-Wno-unused-variable" ) + #################################################################################################### # COMPILE INTEGRATION TESTS @@ -183,6 +188,11 @@ if(BUILD_TESTS) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) + # pFUnit may have a bug which causes a unused variable `class(Test), allocatable :: t` be + # present if the suite contains only a TestCase and its methods + # We need to suppress this warning for clarity + target_compile_options(integrationTests PRIVATE "-Wno-unused-variable" ) + endif() ####################################################################################################