Skip to content

Commit a2332f3

Browse files
committed
Add a transitive dependency to the test case
1 parent c757038 commit a2332f3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

test/framework/easyblock.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3737,17 +3737,19 @@ def test_exts_deps_build_env(self):
37373737
# put dummy modules in place where we can control $EBROOT value
37383738
openmpi_fn = '4.1.5-GCC-12.3.0'
37393739
zlib_fn = '1.2.13-GCCcore-12.3.0'
3740+
cuda_fn = '9.1.85'
37403741
mod_files = [
37413742
('OpenMPI', openmpi_fn),
37423743
('zlib', zlib_fn),
3744+
('CUDA', cuda_fn)
37433745
]
37443746

37453747
test_mods = os.path.join(self.test_prefix, 'modules')
37463748

37473749
for name, mod_fn in mod_files:
37483750
mod_fp = os.path.join(testdir, 'modules', name, mod_fn)
37493751

3750-
header_fn = 'zlib.h' if name == 'zlib' else 'mpi.h'
3752+
header_fn = f'{name}.h' if name != 'OpenMPI' else 'mpi.h'
37513753

37523754
dep_root = os.path.join(self.test_prefix, 'software', name, mod_fn)
37533755
write_file(os.path.join(dep_root, 'include', header_fn), '')
@@ -3758,6 +3760,9 @@ def test_exts_deps_build_env(self):
37583760
# add statement to inject extra subdirectory to $CPATH,
37593761
# which is supposed to be retained in build environment
37603762
mod_txt += f'\nprepend-path\tCPATH\t$root/include/{name}'
3763+
# Add a transitive dependency to zlib
3764+
if name == 'zlib':
3765+
mod_txt += f'\nmodule load CUDA/{cuda_fn}'
37613766

37623767
test_mod_file = os.path.join(test_mods, name, mod_fn)
37633768
write_file(test_mod_file, mod_txt)
@@ -3795,14 +3800,16 @@ def test_exts_deps_build_env(self):
37953800
f'software/OpenMPI/{openmpi_fn}/include',
37963801
f'software/zlib/{zlib_fn}/include/zlib',
37973802
f'software/zlib/{zlib_fn}/include',
3803+
f'software/CUDA/{cuda_fn}/include/CUDA',
3804+
f'software/CUDA/{cuda_fn}/include',
37983805
]
37993806
if env_var.endswith('PATH'):
38003807
regex = re.compile(f'^{env_var}=' + ':'.join('[^ ]+/' + p for p in paths) + '$', re.M)
38013808
elif env_var == 'CPPFLAGS':
38023809
regex = re.compile(f'^{env_var}=' + ' '.join('-I/[^ ]+/' + p for p in paths) + '$', re.M)
38033810
else:
38043811
self.fail(f"Unknown type of environment variable: ${env_var}")
3805-
self.assertTrue(regex.search(log_txt), f"Pattern '{regex.pattern}' not found in log output")
3812+
self.assertTrue(regex.search(log_txt), f"Pattern '{regex.pattern}' not found in log output\n{log_txt}")
38063813

38073814
# verify fix made in https://github.com/easybuilders/easybuild-framework/pull/5048
38083815
test_ec_txt = read_file(toy_ec)

0 commit comments

Comments
 (0)