Skip to content

Extending a TestCase to a base class then extended again doesn't work for me #465

@ekluzek

Description

@ekluzek

I wanted to have a base class that I extend so I can test different types that themselves extends a base class into two specific

So the base class has this structure...

test_DustEmisBase.F90:

  type, extends(TestCase) :: TestDustEmisBase
     integer, allocatable :: filter_nolakep(:)      ! non-lake filter (patches)
     integer :: num_nolakep              ! number of patches in non-lake filter
     type(atm2lnd_type) :: atm2lnd_inst
     type(soilstate_type) :: soilstate_inst
     type(canopystate_type) :: canopystate_inst
     type(temperature_type) :: temperature_inst
     type(unittest_water_type_factory_type) :: water_factory
     type(water_type) :: water_inst
     type(frictionvel_type) :: frictionvel_inst
   contains
     procedure :: setUp_base
     procedure :: setUp_before_subgrid
     procedure :: clean
     procedure :: setupEnvironment
     procedure :: create_atm2lnd
     procedure :: create_fv
     procedure :: print_values
  end type TestDustEmisBase

And the extended class looks like this:

test_DustEmisZender2024.pf

  @TestCase
  type, extends(TestDustEmisBase) :: TestDustEmisZender2003
     type(dust_type) :: dust_emis
   contains
     procedure :: validate_patch
  end type TestDustEmisZender2003

I started this with everything in the extended class and that works fine. It's when I tried to make a base class that it appears that the base class methods don't seem to do anything. So I've got it building, linking and running, but the base methods in the base class don't seem to do anything.

To get it to build I had to have the base class a .F90 file rather than .pf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions