Skip to content

Fix test step for CMakeNinja easyblock by customizing test_cmd and runtest easyconfig parameters #3771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions easybuild/easyblocks/generic/cmakeninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"""
from easybuild.easyblocks.generic.cmakemake import CMakeMake
from easybuild.easyblocks.generic.mesonninja import MesonNinja
from easybuild.framework.easyconfig import BUILD, CUSTOM

DEFAULT_TEST_CMD = 'ninja'


class CMakeNinja(CMakeMake, MesonNinja):
Expand All @@ -45,6 +48,10 @@ def extra_options(extra_vars=None):
key: value for key, value in MesonNinja.extra_options().items()
if key.startswith('build_') or key.startswith('install_')
})
extra_vars.update({
'test_cmd': [DEFAULT_TEST_CMD, "Test command to use ('runtest' value is appended)", CUSTOM],
'runtest': [None, "Ninja target to test build or True to use CTest", BUILD],
})
return extra_vars

def configure_step(self, *args, **kwargs):
Expand Down