Skip to content

Commit

Permalink
Add test for external types in call chain
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed Nov 9, 2023
1 parent 2fffb34 commit 9470fb7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
23 changes: 21 additions & 2 deletions test/test_projects/test_external_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,32 @@
import copy
from urllib.parse import urlparse
import json
from typing import Dict, Any

import ford

from bs4 import BeautifulSoup
import pytest


REMOTE_TYPE_JSON: Dict[str, Any] = {
"name": "remote_type",
"external_url": "./type/remote_type.html",
"obj": "type",
"extends": None,
"variables": [
{
"name": "cptr",
"external_url": "./type/config.html#variable-cptr",
"obj": "variable",
"vartype": "type",
"permission": "public",
},
],
"boundprocs": [],
"permission": "public",
}

REMOTE_MODULES_JSON = [
{
"name": "remote_module",
Expand All @@ -32,7 +51,7 @@
},
},
"pub_absints": {},
"pub_types": {},
"pub_types": {"remote_type": REMOTE_TYPE_JSON},
"pub_vars": {},
"functions": [],
"subroutines": [
Expand All @@ -51,7 +70,7 @@
],
"interfaces": [],
"absinterfaces": [],
"types": [],
"types": [REMOTE_TYPE_JSON],
"variables": [],
}
]
Expand Down
15 changes: 14 additions & 1 deletion test_data/external_project/top_level_project/src/top_level.f90
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
module config_mod
use remote_module
implicit none
contains

function create() result(config)
type (remote_type) :: config
! Checks call chain following when using external entities
config%cptr%buffer(1:1) = 10
end function create
end module config_mod


module myAbort
use external_module
type, public, extends(solverAborts_type) :: vel_abortCriteria_type
Expand Down Expand Up @@ -39,7 +52,7 @@ program top_level

type, extends(test) :: maintest
character(len=10) :: label
end type
end type maintest

call external_sub
call remote_sub
Expand Down

0 comments on commit 9470fb7

Please sign in to comment.