Skip to content

Commit

Permalink
Adapt test_toy_multi_deps test to support *safe auto load*
Browse files Browse the repository at this point in the history
If select ModulesTool supports *safe auto load*, generated modulefiles
use a different syntax.
  • Loading branch information
xdelaruelle committed Sep 1, 2024
1 parent 1cfbfa3 commit 7cc7cfd
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions test/framework/toy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3209,11 +3209,22 @@ def test_toy_multi_deps(self):
'end',
])
else:
expected = '\n'.join([
'if { ![ is-loaded GCC/4.6.3 ] && ![ is-loaded GCC/7.3.0-2.30 ] } {',
' module load GCC/4.6.3',
'}',
])
if not self.modtool.supports_safe_auto_load:
expected = '\n'.join([
'if { ![ is-loaded GCC/4.6.3 ] && ![ is-loaded GCC/7.3.0-2.30 ] } {',
' module load GCC/4.6.3',
'}',
])
else:
expected = '\n'.join([
'',
"if { [ module-info mode remove ] || [ is-loaded GCC/7.3.0-2.30 ] } {",
" module load GCC",
'} else {',
" module load GCC/4.6.3",
'}',
'',
])

self.assertIn(expected, toy_mod_txt)

Expand Down

0 comments on commit 7cc7cfd

Please sign in to comment.