Skip to content

Commit

Permalink
Merge pull request #2837 from Flamefire/20221129132443_new_pr_configu…
Browse files Browse the repository at this point in the history
…remake

allow use of `test_cmd` without `runtest` for `ConfigureMake`
  • Loading branch information
akesandgren authored Sep 14, 2023
2 parents 7c1e717 + 07fb27c commit 9f29e4e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions easybuild/easyblocks/generic/configuremake.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from easybuild.tools.config import source_paths, build_option
from easybuild.tools.filetools import CHECKSUM_TYPE_SHA256, adjust_permissions, compute_checksum, download_file
from easybuild.tools.filetools import read_file, remove_file
from easybuild.tools.py2vs3 import string_type
from easybuild.tools.run import run_cmd

# string that indicates that a configure script was generated by Autoconf
Expand Down Expand Up @@ -192,7 +193,8 @@ def extra_options(extra_vars=None):
'install_cmd': [DEFAULT_INSTALL_CMD, "Install command to use", CUSTOM],
'prefix_opt': [None, "Prefix command line option for configure script ('--prefix=' if None)", CUSTOM],
'tar_config_opts': [False, "Override tar settings as determined by configure.", CUSTOM],
'test_cmd': [DEFAULT_TEST_CMD, "Test command to use ('runtest' value is appended)", CUSTOM],
'test_cmd': [None, "Test command to use ('runtest' value is appended, default: '%s')" % DEFAULT_TEST_CMD,
CUSTOM],
})
return extra_vars

Expand Down Expand Up @@ -337,7 +339,7 @@ def build_step(self, verbose=False, path=None):

targets = self.cfg.get('build_cmd_targets') or DEFAULT_BUILD_TARGET
# ensure strings are converted to list
targets = [targets] if isinstance(targets, str) else targets
targets = [targets] if isinstance(targets, string_type) else targets

for target in targets:
cmd = ' '.join([
Expand All @@ -360,13 +362,13 @@ def test_step(self):
"""

test_cmd = self.cfg.get('test_cmd') or DEFAULT_TEST_CMD
if self.cfg['runtest'] or test_cmd != DEFAULT_TEST_CMD:
cmd = ' '.join([
self.cfg['pretestopts'],
test_cmd,
self.cfg['runtest'],
self.cfg['testopts'],
])
runtest = self.cfg['runtest']
if runtest or test_cmd != DEFAULT_TEST_CMD:
# Make run_test a string (empty if it is e.g. a boolean)
if not isinstance(runtest, string_type):
runtest = ''
# Compose command filtering out empty values
cmd = ' '.join([x for x in (self.cfg['pretestopts'], test_cmd, runtest, self.cfg['testopts']) if x])
(out, _) = run_cmd(cmd, log_all=True, simple=False)

return out
Expand Down

0 comments on commit 9f29e4e

Please sign in to comment.