@@ -421,6 +421,45 @@ def test_make_module_dep(self):
421421 expected = tc_load + '\n \n ' + fftw_load + '\n \n ' + lapack_load
422422 self .assertEqual (eb .make_module_dep (unload_info = unload_info ).strip (), expected )
423423
424+ def test_make_module_dep_hmns (self ):
425+ """Test for make_module_dep under HMNS"""
426+ test_ecs_path = os .path .join (os .path .dirname (os .path .abspath (__file__ )), 'easyconfigs' , 'test_ecs' )
427+ all_stops = [x [0 ] for x in EasyBlock .get_steps ()]
428+ build_options = {
429+ 'check_osdeps' : False ,
430+ 'robot_path' : [test_ecs_path ],
431+ 'valid_stops' : all_stops ,
432+ 'validate' : False ,
433+ }
434+ os .environ ['EASYBUILD_MODULE_NAMING_SCHEME' ] = 'HierarchicalMNS'
435+ init_config (build_options = build_options )
436+ self .setup_hierarchical_modules ()
437+
438+ self .contents = '\n ' .join ([
439+ 'easyblock = "ConfigureMake"' ,
440+ 'name = "pi"' ,
441+ 'version = "3.14"' ,
442+ 'homepage = "http://example.com"' ,
443+ 'description = "test easyconfig"' ,
444+ "toolchain = {'name': 'goolf', 'version': '1.4.10'}" ,
445+ 'dependencies = [' ,
446+ " ('GCC', '4.7.2', '', True),"
447+ " ('hwloc', '1.6.2', '', ('GCC', '4.7.2'))," ,
448+ " ('OpenMPI', '1.6.4', '', ('GCC', '4.7.2')),"
449+ ']' ,
450+ ])
451+ self .writeEC ()
452+ eb = EasyBlock (EasyConfig (self .eb_file ))
453+
454+ eb .installdir = os .path .join (config .install_path (), 'pi' , '3.14' )
455+ eb .check_readiness_step ()
456+
457+ # GCC, OpenMPI and hwloc modules should *not* be included in loads for dependencies
458+ mod_dep_txt = eb .make_module_dep ()
459+ for mod in ['GCC/4.7.2' , 'OpenMPI/1.6.4' , 'hwloc/1.6.2' ]:
460+ regex = re .compile ('load.*%s' % mod )
461+ self .assertFalse (regex .search (mod_dep_txt ), "Pattern '%s' found in: %s" % (regex .pattern , mod_dep_txt ))
462+
424463 def test_extensions_step (self ):
425464 """Test the extensions_step"""
426465 self .contents = '\n ' .join ([
0 commit comments