Skip to content

Commit

Permalink
Cleanup - eliminating various compiler warnings.
Browse files Browse the repository at this point in the history
Most warnings that remain are due to dependencies.  E.g., on macOS
there are numerous warnings from ranlib about object files that have
"no symbols".   A fix for these is known and will be propagated soon.
  • Loading branch information
tclune committed Apr 8, 2019
1 parent f009fff commit 8ea3c8a
Show file tree
Hide file tree
Showing 21 changed files with 56 additions and 31 deletions.
1 change: 0 additions & 1 deletion src/funit/FUnit.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/funit/core/DotPattern.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module PF_DotPattern
use PF_AbstractPattern
use PF_MatchObject
Expand All @@ -21,6 +23,7 @@ module PF_DotPattern

function new_DotPattern() result(pattern)
type (DotPattern) :: pattern
_UNUSED_DUMMY(pattern)
end function new_DotPattern


Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/funit/core/File.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/funit/core/MockRepository.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 0 additions & 6 deletions src/funit/core/RemoteProxyTestCase.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion src/funit/core/RemoteRunner.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions src/funit/core/RobustRunner.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/funit/core/TestRunner.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/funit/core/TestTimer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/funit/fhamcrest/AllOf.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_AllOf
use pf_AbstractMatcher
use pf_MatcherDescription
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
7 changes: 4 additions & 3 deletions src/funit/fhamcrest/AnyOf.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_AnyOf
use pf_AbstractMatcher
use pf_BaseMatcher
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions src/funit/fhamcrest/BaseMatcher.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_BaseMatcher
use pf_AbstractMatcher
use pf_MatcherDescription
Expand All @@ -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)

Expand Down
5 changes: 5 additions & 0 deletions src/funit/fhamcrest/IsArrayWithSize.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_IsArrayWithSize
use pf_AbstractMatcher
use pf_MatcherDescription
Expand Down Expand Up @@ -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)
Expand All @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/funit/fhamcrest/IsEqual.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_IsEqual
use iso_fortran_env
use pf_AbstractMatcher
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/funit/fhamcrest/IsNear.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_IsNear
use pf_TypeSafeMatcher
use pf_MatcherDescription
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/funit/fhamcrest/IsNot.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_IsNot
use pf_AbstractMatcher
use pf_BaseMatcher
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions src/funit/fhamcrest/IsRelativelyNear.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_IsRelativelyNear
use pf_TypeSafeMatcher
use pf_MatcherDescription
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions src/funit/fhamcrest/SubstringMatcher.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "unused_dummy.fh"

module pf_SubstringMatcher
use pf_MatcherDescription
use pf_AbstractMatcher
Expand Down Expand Up @@ -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(*))
Expand Down Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion tests/fhamcrest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
7 changes: 7 additions & 0 deletions tests/fhamcrest/Test_IsEqual_extended.pf
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions tests/funit-core/serial_tests.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8ea3c8a

Please sign in to comment.