3131 'crt' ,
3232 'mt3dms' ,
3333 'mf2005dbl' ,
34- 'zonbud3 ' ,
34+ 'zonbud ' ,
3535 'gridgen' ,
3636 'mflgrdbl' ,
3737 'mfnwt' ,
5959 "modflow6-nightly-build" : ["libmf6" ]
6060}
6161
62+ # executables that have been renamed upstream at some point; accept the old
63+ # name too, so tests pass against both latest and older pinned release tags
64+ exe_aliases = {
65+ 'zonbud' : ['zonbud3' ],
66+ }
67+
6268# apply subset filter, if provided
6369if subset :
6470 expected_exes = {k : [vv for vv in v if vv in subset ] for k , v in expected_exes .items ()}
@@ -98,6 +104,14 @@ def get_expected_files(repository) -> Tuple[List[str], List[str]]:
98104 return exes , libs
99105
100106
107+ def alt_names (exe ) -> List [str ]:
108+ """Given an (possibly suffixed) expected exe name, return itself plus any
109+ known former/alternate names it may appear as, with the same suffix."""
110+ base , _ , suffix = exe .partition ('.' )
111+ suffix = f".{ suffix } " if suffix else ""
112+ return [exe ] + [f"{ alias } { suffix } " for alias in exe_aliases .get (base , [])]
113+
114+
101115# check install location exists
102116assert path .is_dir (), f"Install location { path } doesn't exist"
103117print (f"Found install location: { path } " )
@@ -109,15 +123,17 @@ def get_expected_files(repository) -> Tuple[List[str], List[str]]:
109123
110124# check executables exist
111125found = sorted ([p .name for p in path .glob ("*" )])
126+ found_set = set (found )
112127exp_exes , exp_libs = get_expected_files (repo )
113128expected = exp_exes + exp_libs
114- assert set (found ) >= set (exp_exes ), f"Executables/libraries missing:\n Found { set (found )} \n Expected { set (exp_exes )} "
129+ missing = [exe for exe in exp_exes if not (set (alt_names (exe )) & found_set )]
130+ assert not missing , f"Executables/libraries missing:\n Found { found_set } \n Expected { set (exp_exes )} "
115131print (f"Found all expected executables/libraries:" )
116132pprint (expected )
117133
118134# check executables are on the PATH
119135for exe in exp_exes :
120- assert which (exe ), f"Executable { exe } not found on path"
136+ assert any ( which (name ) for name in alt_names ( exe ) ), f"Executable { exe } not found on path"
121137print (f"Verified executables are on system path" )
122138
123139
0 commit comments