diff --git a/src/funit/FUnit.F90 b/src/funit/FUnit.F90 index 68bd8d3a..4a3eb14c 100644 --- a/src/funit/FUnit.F90 +++ b/src/funit/FUnit.F90 @@ -31,7 +31,6 @@ logical function run(load_tests) result(status) class(BaseTestRunner), allocatable :: runner type (TestResult) :: r type (SerialContext) :: c - type (TestListenerVector) :: listeners type(ArgParser), target :: parser logical :: debug type (StringUnlimitedMap) :: options diff --git a/src/funit/core/DotPattern.F90 b/src/funit/core/DotPattern.F90 index 2352d8d0..b5acce10 100644 --- a/src/funit/core/DotPattern.F90 +++ b/src/funit/core/DotPattern.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module PF_DotPattern use PF_AbstractPattern use PF_MatchObject @@ -21,6 +23,7 @@ module PF_DotPattern function new_DotPattern() result(pattern) type (DotPattern) :: pattern + _UNUSED_DUMMY(pattern) end function new_DotPattern @@ -29,6 +32,8 @@ function match(this, string) class (DotPattern), intent(in) :: this character(len=*), intent(in) :: string + _UNUSED_DUMMY(this) + if (len(string) > 0) then match%found = .true. match%num_characters = 1 diff --git a/src/funit/core/File.F90 b/src/funit/core/File.F90 index ff9992a9..b1c95b30 100644 --- a/src/funit/core/File.F90 +++ b/src/funit/core/File.F90 @@ -69,7 +69,6 @@ subroutine timed_read_line(this, line, timer, rc) type(TestTimer), intent(in) :: timer integer, intent(out) :: rc - integer :: line_length integer :: status type(pollfd) :: fds(1) integer(kind=C_INT) :: timeout @@ -149,7 +148,6 @@ end subroutine timed_read_line subroutine file_close(this, rc) class(File), intent(inout) :: this integer(kind=C_INT), intent(out) :: rc - integer :: status rc = close(this%file_descriptor) end subroutine file_close diff --git a/src/funit/core/MockRepository.F90 b/src/funit/core/MockRepository.F90 index d1054170..056edc6c 100644 --- a/src/funit/core/MockRepository.F90 +++ b/src/funit/core/MockRepository.F90 @@ -158,7 +158,6 @@ end subroutine hasCalled subroutine addExpectationThat_sub_(this,sub,pred) class (MockRepository), intent(inout) :: this procedure(subVoid), pointer, intent(in) :: sub -! procedure(subVoid), pointer, intent(in) :: subptr class(Predicate), intent(in) :: pred type(Expectation) exp @@ -175,8 +174,6 @@ end subroutine addExpectationThat_sub_ subroutine addExpectationThat_subNameOnly_(this,subName,pred) class (MockRepository), intent(inout) :: this character(len=*), intent(in) :: subName -! procedure(subVoid), pointer, intent(in) :: sub -! procedure(subVoid), pointer, intent(in) :: subptr class (Predicate), intent(in) :: pred type(Expectation) exp diff --git a/src/funit/core/RemoteProxyTestCase.F90 b/src/funit/core/RemoteProxyTestCase.F90 index e8052a12..117cc91d 100644 --- a/src/funit/core/RemoteProxyTestCase.F90 +++ b/src/funit/core/RemoteProxyTestCase.F90 @@ -27,8 +27,6 @@ module PF_RemoteProxyTestCase use pf_DisableAnnotation use PF_Test use PF_TestCase - use, intrinsic :: iso_fortran_env, only: INT64 - use, intrinsic :: iso_fortran_env, only: IOSTAT_EOR use iso_c_binding use pf_Posix use pf_File @@ -89,17 +87,13 @@ subroutine runMethod(this) use PF_UnixPipeInterfaces class (RemoteProxyTestCase), intent(inout) :: this - type (pollfd) :: fds(1) - integer :: error character(:), allocatable :: line character(:), allocatable :: file_name integer :: line_number character(:), allocatable :: num_exceptions_str character(:), allocatable :: line_number_str - character(:), allocatable :: message_length_str integer :: num_exceptions character(:), allocatable :: message - integer :: message_length integer :: i_exception integer :: rc diff --git a/src/funit/core/RemoteRunner.F90 b/src/funit/core/RemoteRunner.F90 index 1d2adee1..fd8141ed 100644 --- a/src/funit/core/RemoteRunner.F90 +++ b/src/funit/core/RemoteRunner.F90 @@ -89,7 +89,6 @@ function newRemoteRunner(numSkip, unit) result(runner) end function newRemoteRunner function run(this, aTest, context) result(result) - use, intrinsic :: iso_fortran_env, only: OUTPUT_UNIT use PF_Test use PF_TestVector use PF_ParallelContext diff --git a/src/funit/core/RobustRunner.F90 b/src/funit/core/RobustRunner.F90 index 9b6004a1..758c3769 100644 --- a/src/funit/core/RobustRunner.F90 +++ b/src/funit/core/RobustRunner.F90 @@ -120,7 +120,6 @@ function new_RobustRunner_printer(printer, maxLaunchDuration, max_time_per_test, function get_default_launch_command() result(command) character(:), allocatable :: command - character(:), allocatable :: arg integer :: n call get_command_argument(0, length=n) @@ -150,14 +149,11 @@ subroutine runWithResult(this, aTest, context, result) type (TestVector) :: testCases type (RemoteProxyTestCase) :: proxy integer :: i - integer :: clockStart, clockStop, clockRate type(mode_t) :: mode integer(kind=C_INT) :: status integer :: rc - logical :: check logical :: needs_launch type (File) :: f - real :: elapsed_time call result%addListener( this ) ! - monitoring @@ -214,11 +210,7 @@ subroutine launchRemoteRunner(this, f, numSkip) integer :: status character(len=MAX_LEN) :: suffix - character(len=80) :: timeCommand - type (UnixProcess) :: timerProcess - character(len=:), allocatable :: line character(:), allocatable :: buffer - character(len=100) :: throwMessage type (TestTimer) :: timer @@ -263,6 +255,7 @@ subroutine startTest(this, testName) class (RobustRunner), intent(inout) :: this character(len=*), intent(in) :: testName + _UNUSED_DUMMY(this) _UNUSED_DUMMY(testName) end subroutine startTest diff --git a/src/funit/core/TestRunner.F90 b/src/funit/core/TestRunner.F90 index d8f6308a..d4d3fc4b 100644 --- a/src/funit/core/TestRunner.F90 +++ b/src/funit/core/TestRunner.F90 @@ -105,7 +105,6 @@ recursive function run(this, aTest, context) result(result) integer :: clock_start integer :: clock_stop integer :: clock_rate - integer :: i real :: elapsed_time call system_clock(clock_start) @@ -133,6 +132,8 @@ recursive subroutine runWithResult(this, aTest, context, result) class (Test), intent(inout) :: aTest class (ParallelContext), intent(in) :: context type (TestResult), intent(inout) :: result + + _UNUSED_DUMMY(this) call aTest%run(result, context) diff --git a/src/funit/core/TestTimer.F90 b/src/funit/core/TestTimer.F90 index d6649dd3..27435b58 100644 --- a/src/funit/core/TestTimer.F90 +++ b/src/funit/core/TestTimer.F90 @@ -26,7 +26,7 @@ function new_TestTimer(max_time) result(timer) type(TestTimer) :: timer real, intent(in) :: max_time - integer(kind=INT64) :: count, count_rate + integer(kind=INT64) :: count_rate call system_clock(timer%start_count, count_rate) timer%max_count = timer%start_count + ceiling(1000*max_time) * count_rate/1000 diff --git a/src/funit/fhamcrest/AllOf.F90 b/src/funit/fhamcrest/AllOf.F90 index ec907423..4ef2e067 100644 --- a/src/funit/fhamcrest/AllOf.F90 +++ b/src/funit/fhamcrest/AllOf.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_AllOf use pf_AbstractMatcher use pf_MatcherDescription @@ -103,8 +105,6 @@ subroutine describe_to(this, description) class(AllOf), intent(in):: this class(MatcherDescription), intent(inout) :: description - integer :: i - call this%describe_to_op(description, "and") end subroutine describe_to @@ -133,6 +133,8 @@ subroutine describe_mismatch(this, actual, description) class(*), intent(in) :: actual class(MatcherDescription), intent(inout) :: description + _UNUSED_DUMMY(this) + call description%append_text("was ") call description%append_value(actual) diff --git a/src/funit/fhamcrest/AnyOf.F90 b/src/funit/fhamcrest/AnyOf.F90 index e5d17b11..52fbb36c 100644 --- a/src/funit/fhamcrest/AnyOf.F90 +++ b/src/funit/fhamcrest/AnyOf.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_AnyOf use pf_AbstractMatcher use pf_BaseMatcher @@ -85,7 +87,6 @@ logical function matches(this, actual_value) class(AnyOf), intent(in) :: this class(*), intent(in) :: actual_value - integer :: i type(MatcherVectorIterator) :: iter class(AbstractMatcher), pointer :: matcher @@ -109,8 +110,6 @@ subroutine describe_to(this, description) class(AnyOf), intent(in):: this class(MatcherDescription), intent(inout) :: description - integer :: i - call this%describe_to_op(description, "or") end subroutine describe_to @@ -140,6 +139,8 @@ subroutine describe_mismatch(this, actual, description) class(*), intent(in) :: actual class(MatcherDescription), intent(inout) :: description + _UNUSED_DUMMY(this) + call description%append_text("was ") call description%append_value(actual) diff --git a/src/funit/fhamcrest/BaseMatcher.F90 b/src/funit/fhamcrest/BaseMatcher.F90 index 87e121b3..17322bf5 100644 --- a/src/funit/fhamcrest/BaseMatcher.F90 +++ b/src/funit/fhamcrest/BaseMatcher.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_BaseMatcher use pf_AbstractMatcher use pf_MatcherDescription @@ -19,6 +21,7 @@ subroutine describe_mismatch(this, actual, description) class(*), intent(in) :: actual class(MatcherDescription), intent(inout) :: description + _UNUSED_DUMMY(this) call description%append_text("was ") call description%append_value(actual) diff --git a/src/funit/fhamcrest/IsArrayWithSize.F90 b/src/funit/fhamcrest/IsArrayWithSize.F90 index 43d7b878..6d496461 100644 --- a/src/funit/fhamcrest/IsArrayWithSize.F90 +++ b/src/funit/fhamcrest/IsArrayWithSize.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_IsArrayWithSize use pf_AbstractMatcher use pf_MatcherDescription @@ -58,6 +60,7 @@ function feature_value_of(this, actual) result(feature_value) class(IsArrayWithSize), intent(in) :: this class(*), intent(in) :: actual + _UNUSED_DUMMY(this) select type (actual) type is (internal_array_1d) feature_value = size(actual%items) @@ -80,6 +83,8 @@ logical function expects_type_of(this, actual) class(IsArrayWithSize), intent(in) :: this class(*), intent(in) :: actual + _UNUSED_DUMMY(this) + select type(actual) type is (internal_array_1d) expects_type_of = .true. diff --git a/src/funit/fhamcrest/IsEqual.F90 b/src/funit/fhamcrest/IsEqual.F90 index 55ce3b97..c29af818 100644 --- a/src/funit/fhamcrest/IsEqual.F90 +++ b/src/funit/fhamcrest/IsEqual.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_IsEqual use iso_fortran_env use pf_AbstractMatcher @@ -59,6 +61,9 @@ subroutine describe_mismatch(this, actual, description) class(IsEqual), intent(in) :: this class(*), intent(in) :: actual class(MatcherDescription), intent(inout) :: description + + _UNUSED_DUMMY(this) + call description%append_text("was ") call description%append_value(actual) end subroutine describe_mismatch @@ -92,6 +97,8 @@ logical function matches_list(this, expected_items, actual_value) integer :: i, n_items type (IsEqual) :: m + _UNUSED_DUMMY(this) + select type (a => actual_value) type is (internal_array_1d) n_items = size(expected_items) diff --git a/src/funit/fhamcrest/IsNear.F90 b/src/funit/fhamcrest/IsNear.F90 index 181295ae..a032eeab 100644 --- a/src/funit/fhamcrest/IsNear.F90 +++ b/src/funit/fhamcrest/IsNear.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_IsNear use pf_TypeSafeMatcher use pf_MatcherDescription @@ -91,6 +93,8 @@ logical function expects_type_of(this, actual) result(supported) class(IsNear), intent(in) :: this class(*), intent(in) :: actual + _UNUSED_DUMMY(this) + select type (actual) type is (real) supported = .true. diff --git a/src/funit/fhamcrest/IsNot.F90 b/src/funit/fhamcrest/IsNot.F90 index 7bc1ab3d..f66c05f8 100644 --- a/src/funit/fhamcrest/IsNot.F90 +++ b/src/funit/fhamcrest/IsNot.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_IsNot use pf_AbstractMatcher use pf_BaseMatcher @@ -64,6 +66,8 @@ subroutine describe_mismatch(this, actual, description) class(*), intent(in) :: actual class(MatcherDescription), intent(inout) :: description + _UNUSED_DUMMY(this) + call description%append_text("was ") call description%append_value(actual) diff --git a/src/funit/fhamcrest/IsRelativelyNear.F90 b/src/funit/fhamcrest/IsRelativelyNear.F90 index 14d84a40..d2ecc818 100644 --- a/src/funit/fhamcrest/IsRelativelyNear.F90 +++ b/src/funit/fhamcrest/IsRelativelyNear.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_IsRelativelyNear use pf_TypeSafeMatcher use pf_MatcherDescription @@ -86,6 +88,7 @@ logical function expects_type_of(this, actual) result(supported) class(IsRelativelyNear), intent(in) :: this class(*), intent(in) :: actual + _UNUSED_DUMMY(this) select type (actual) type is (real) supported = .true. diff --git a/src/funit/fhamcrest/SubstringMatcher.F90 b/src/funit/fhamcrest/SubstringMatcher.F90 index 7f15e5bc..f3e05f73 100644 --- a/src/funit/fhamcrest/SubstringMatcher.F90 +++ b/src/funit/fhamcrest/SubstringMatcher.F90 @@ -1,3 +1,5 @@ +#include "unused_dummy.fh" + module pf_SubstringMatcher use pf_MatcherDescription use pf_AbstractMatcher @@ -93,6 +95,8 @@ subroutine describe_mismatch_safely(this, actual, description) class(*), intent(in) :: actual class(MatcherDescription), intent(inout) :: description + _UNUSED_DUMMY(this) + call description%append_text('was "') select type (actual) type is (character(*)) @@ -121,6 +125,8 @@ logical function expects_type_of(this, actual) class(SubstringMatcher), intent(in) :: this class(*), intent(in) :: actual + _UNUSED_DUMMY(this) + select type (actual) type is (character(*)) expects_type_of = .true. diff --git a/tests/fhamcrest/CMakeLists.txt b/tests/fhamcrest/CMakeLists.txt index 595e2185..7407d613 100644 --- a/tests/fhamcrest/CMakeLists.txt +++ b/tests/fhamcrest/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.0) include_directories (${PFUNIT_SOURCE_DIR}/include) include_directories (${PFUNIT_BINARY_DIR}/src) -include_directories(${CMAKE_BINARY_DIR}/mod) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/tests/fhamcrest/Test_IsEqual_extended.pf b/tests/fhamcrest/Test_IsEqual_extended.pf index 6810a07c..69f3b107 100644 --- a/tests/fhamcrest/Test_IsEqual_extended.pf +++ b/tests/fhamcrest/Test_IsEqual_extended.pf @@ -1,4 +1,6 @@ + ! Test that derived types can be used with matchers +#include "unused_dummy.fh" module Test_IsEqual_extended use funit implicit none @@ -72,6 +74,11 @@ contains integer, intent(out) :: iostat character(*), intent(inout) :: iomsg + _UNUSED_DUMMY(iotype) + _UNUSED_DUMMY(vlist) + _UNUSED_DUMMY(iostat) + _UNUSED_DUMMY(iomsg) + write(unit,'(a,i0,a)') 'MyMatchable(', this%i, ')' end subroutine write_formatted diff --git a/tests/funit-core/serial_tests.F90 b/tests/funit-core/serial_tests.F90 index bfc51791..16d65baa 100644 --- a/tests/funit-core/serial_tests.F90 +++ b/tests/funit-core/serial_tests.F90 @@ -2,7 +2,6 @@ program main use FUnit, only: initialize use FUnit, only: finalize use FUnit, only: TestResult - use FUnit, only: TestListenerVector use FUnit, only: stub !$$ use FUnit, only: DebugListener implicit none @@ -43,7 +42,6 @@ logical function runTests() result(success) use Test_RobustRunner, only: testRobustRunnerSuite => suite - use iso_fortran_env, only: OUTPUT_UNIT type (TestSuite) :: allTests type (TestRunner) :: runner