@@ -1433,9 +1433,17 @@ def test_compiler_cache(self):
14331433 self .assertTrue (regex .search (out ), "Pattern '%s' found in: %s" % (regex .pattern , out ))
14341434
14351435 # $CCACHE_DIR is defined by toolchain.prepare(), and should still be defined after running 'eb'
1436+ ccache_path = os .path .join (self .test_prefix , 'scripts' , 'ccache' )
14361437 self .assertTrue (os .path .samefile (os .environ ['CCACHE_DIR' ], ccache_dir ))
1437- for comp in ['gcc' , 'g++' , 'gfortran' ]:
1438- self .assertTrue (os .path .samefile (which (comp ), os .path .join (self .test_prefix , 'scripts' , 'ccache' )))
1438+ for comp in ['gcc' , 'g++' ]:
1439+ comp_path = which (comp )
1440+ self .assertTrue (comp_path )
1441+ self .assertTrue (os .path .samefile (comp_path , ccache_path ))
1442+
1443+ # no ccache wrapper for gfortran when using ccache
1444+ # (ccache either doesn't support Fortran anymore, or support is spotty (trouble with Fortran modules))
1445+ gfortran_path = which ('gfortran' )
1446+ self .assertTrue (gfortran_path is None or not os .path .samefile (gfortran_path , ccache_path ))
14391447
14401448 # reset environment to get rid of ccache symlinks, but with ccache/f90cache mock scripts still in place
14411449 os .environ ['PATH' ] = prepped_path_envvar
0 commit comments