@@ -433,12 +433,13 @@ def test_make_module_req(self):
433
433
434
434
# create fake directories and files that should be guessed
435
435
os .makedirs (eb .installdir )
436
- write_file (os .path .join (eb .installdir , 'foo.jar' ), 'foo.jar' )
437
- write_file (os .path .join (eb .installdir , 'bla.jar' ), 'bla.jar' )
438
436
for path in ('bin' , ('bin' , 'testdir' ), 'sbin' , 'share' , ('share' , 'man' ), 'lib' , 'lib64' ):
439
437
if isinstance (path , str ):
440
438
path = (path , )
441
439
os .mkdir (os .path .join (eb .installdir , * path ))
440
+ write_file (os .path .join (eb .installdir , 'foo.jar' ), 'foo.jar' )
441
+ write_file (os .path .join (eb .installdir , 'bla.jar' ), 'bla.jar' )
442
+ write_file (os .path .join (eb .installdir , 'share' , 'man' , 'pi' ), 'Man page' )
442
443
# this is not a path that should be picked up
443
444
os .mkdir (os .path .join (eb .installdir , 'CPATH' ))
444
445
@@ -519,7 +520,7 @@ def test_make_module_req(self):
519
520
guess , re .M )), 1 )
520
521
521
522
# check for behavior when a string value is used as dict value by make_module_req_guesses
522
- eb .make_module_req_guess = lambda : {'PATH' : 'bin' }
523
+ eb .make_module_req_guess = lambda : {'PATH' : ([ 'bin' ], False ) }
523
524
with eb .module_generator .start_module_creation ():
524
525
txt = eb .make_module_req ()
525
526
if get_module_syntax () == 'Tcl' :
@@ -531,7 +532,7 @@ def test_make_module_req(self):
531
532
532
533
# check for correct behaviour if empty string is specified as one of the values
533
534
# prepend-path statements should be included for both the 'bin' subdir and the install root
534
- eb .make_module_req_guess = lambda : {'PATH' : ['bin' , '' ]}
535
+ eb .make_module_req_guess = lambda : {'PATH' : ( ['bin' , '' ], False ) }
535
536
with eb .module_generator .start_module_creation ():
536
537
txt = eb .make_module_req ()
537
538
if get_module_syntax () == 'Tcl' :
@@ -544,7 +545,9 @@ def test_make_module_req(self):
544
545
self .fail ("Unknown module syntax: %s" % get_module_syntax ())
545
546
546
547
# check for correct order of prepend statements when providing a list (and that no duplicates are allowed)
547
- eb .make_module_req_guess = lambda : {'LD_LIBRARY_PATH' : ['lib/pathC' , 'lib/pathA' , 'lib/pathB' , 'lib/pathA' ]}
548
+ eb .make_module_req_guess = lambda : {
549
+ 'LD_LIBRARY_PATH' : (['lib/pathC' , 'lib/pathA' , 'lib/pathB' , 'lib/pathA' ], False ),
550
+ }
548
551
for path in ['pathA' , 'pathB' , 'pathC' ]:
549
552
os .mkdir (os .path .join (eb .installdir , 'lib' , path ))
550
553
write_file (os .path .join (eb .installdir , 'lib' , path , 'libfoo.so' ), 'test' )
@@ -572,7 +575,7 @@ def test_make_module_req(self):
572
575
# If PATH or LD_LIBRARY_PATH contain only folders, do not add an entry
573
576
sub_lib_path = os .path .join ('lib' , 'path_folders' )
574
577
sub_path_path = os .path .join ('bin' , 'path_folders' )
575
- eb .make_module_req_guess = lambda : {'LD_LIBRARY_PATH' : sub_lib_path , 'PATH' : sub_path_path }
578
+ eb .make_module_req_guess = lambda : {'LD_LIBRARY_PATH' : ( sub_lib_path , False ), 'PATH' : ( sub_path_path , False ) }
576
579
for path in (sub_lib_path , sub_path_path ):
577
580
full_path = os .path .join (eb .installdir , path , 'subpath' )
578
581
os .makedirs (full_path )
0 commit comments