You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a fixture in a separate module will give a linker error (see below). Using a fixture in a separate module would allow reuse for several tests in different files/modules. If I put the fixture in the same module, the code compiles. I have also seen errors with access to private variable tree when I moved the fixture module to a separate file, but currently cannot reproduce that.
Code:
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! fixtures for adios tests
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module fixture
! load unit test
use funit
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! fixture to set exception handling
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@TestCase
type, extends(TestCase) :: basic_setup
contains
! setup routine
procedure :: setup
! finalize routine
procedure :: teardown
end type basic_setup
contains
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! basic setup routine
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutinesetUp(this)
! variable declaration
implicit none
! object
class(basic_setup), intent(inout) :: this
endsubroutine setUp
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! basic finalize routine
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutinetearDown(this)
! variable declaration
implicit none
! object
class(basic_setup), intent(inout) :: this
endsubroutine tearDown
end module fixture
module test_fixture
! load unit test
use funit
use fixture
contains
@Test
subroutinetest_procedure(self)
class(basic_setup), intent(inout) :: self
endsubroutine test_procedure
end module test_fixture
CMake (unit_test links in pfunit and the application)
Using a fixture in a separate module will give a linker error (see below). Using a fixture in a separate module would allow reuse for several tests in different files/modules. If I put the fixture in the same module, the code compiles. I have also seen errors with access to private variable
tree
when I moved the fixture module to a separate file, but currently cannot reproduce that.Code:
CMake (unit_test links in pfunit and the application)
add_pfunit_ctest( test_fixture TEST_SOURCES test_fixture.pf LINK_LIBRARIES unit_test )
Error message
The text was updated successfully, but these errors were encountered: