Skip to content

Commit 8b51ccf

Browse files
authored
Merge pull request #3595 from pavelToman/patch-1
add support to OpenFOAM easyblock for custom `sanity_check_motorbike` easyconfig parameter to opt out of running motorBike tutorial example during sanity check
2 parents 6e92d69 + 1d30c89 commit 8b51ccf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

easybuild/easyblocks/o/openfoam.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import easybuild.tools.toolchain as toolchain
4949
from easybuild.easyblocks.generic.cmakemake import setup_cmake_env
5050
from easybuild.framework.easyblock import EasyBlock
51+
from easybuild.framework.easyconfig import CUSTOM
5152
from easybuild.tools.build_log import EasyBuildError
5253
from easybuild.tools.filetools import adjust_permissions, apply_regex_substitutions, mkdir, write_file
5354
from easybuild.tools.modules import get_software_root, get_software_version
@@ -58,6 +59,15 @@
5859
class EB_OpenFOAM(EasyBlock):
5960
"""Support for building and installing OpenFOAM."""
6061

62+
@staticmethod
63+
def extra_options():
64+
"""Custom easyconfig parameter specific to OpenFOAM."""
65+
extra_vars = EasyBlock.extra_options()
66+
extra_vars.update({
67+
'sanity_check_motorbike': [True, "Should the motorbike sanity check run?", CUSTOM],
68+
})
69+
return extra_vars
70+
6171
def __init__(self, *args, **kwargs):
6272
"""Specify that OpenFOAM should be built in install dir."""
6373

@@ -540,7 +550,8 @@ def sanity_check_step(self):
540550

541551
# run motorBike tutorial case to ensure the installation is functional (if it's available);
542552
# only for recent (>= v6.0) versions of openfoam.org variant
543-
if self.is_dot_org and self.looseversion >= LooseVersion('6'):
553+
# could be turned off by set 'sanity_check_motorbike' to False (default True)
554+
if self.is_dot_org and self.looseversion >= LooseVersion('6') and self.cfg['sanity_check_motorbike']:
544555
openfoamdir_path = os.path.join(self.installdir, self.openfoamdir)
545556
if self.looseversion <= LooseVersion('10'):
546557
motorbike_path = os.path.join(

0 commit comments

Comments
 (0)