Skip to content

Commit 0cf157c

Browse files
committed
Add dependencies of a test in --list-detailed output
1 parent c0d45ae commit 0cf157c

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

reframe/frontend/cli.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
ReframeFatalError, ReframeForceExitError, SystemAutodetectionError
2626
)
2727
from reframe.core.exceptions import format_exception
28+
from reframe.core.pipeline import (DEPEND_EXACT, DEPEND_BY_ENV, DEPEND_FULLY)
2829
from reframe.frontend.executors import Runner, generate_testcases
2930
from reframe.frontend.executors.policies import (SerialExecutionPolicy,
3031
AsynchronousExecutionPolicy)
@@ -33,19 +34,29 @@
3334

3435

3536
def format_check(check, detailed):
37+
def dep_type(t):
38+
if t == DEPEND_EXACT:
39+
return 'DEPEND_EXACT'
40+
elif t == DEPEND_BY_ENV:
41+
return 'DEPEND_BY_ENV'
42+
elif t == DEPEND_FULLY:
43+
return 'DEPEND_FULLY'
44+
3645
lines = [' * %s (found in %s)' % (check.name,
3746
inspect.getfile(type(check)))]
3847
flex = 'flexible' if check.num_tasks <= 0 else 'standard'
3948

4049
if detailed:
4150
lines += [
42-
' - description: %s' % check.descr,
43-
' - systems: %s' % ', '.join(check.valid_systems),
44-
' - environments: %s' % ', '.join(check.valid_prog_environs),
45-
' - modules: %s' % ', '.join(check.modules),
46-
' - task allocation: %s' % flex,
47-
' - tags: %s' % ', '.join(check.tags),
48-
' - maintainers: %s' % ', '.join(check.maintainers)
51+
f" - description: {check.descr}",
52+
f" - systems: {', '.join(check.valid_systems)}",
53+
f" - environments: {', '.join(check.valid_prog_environs)}",
54+
f" - modules: {', '.join(check.modules)}",
55+
f" - task allocation: {flex}",
56+
f" - dependencies: "
57+
f"{[(n, dep_type(t), s) for (n, t, s) in check.user_deps()]}",
58+
f" - tags: {', '.join(check.tags)}",
59+
f" - maintainers: {', '.join(check.maintainers)}"
4960
]
5061

5162
return '\n'.join(lines)

0 commit comments

Comments
 (0)