3333from reframe .frontend .printer import PrettyPrinter
3434
3535
36- def format_check (check , detailed = False ):
36+ def format_check (check , check_deps , detailed = False ):
3737 def fmt_list (x ):
3838 if not x :
3939 return '<none>'
4040
4141 return ', ' .join (x )
4242
43+ def fmt_deps ():
44+ no_deps = True
45+ lines = []
46+ for t , deps in check_deps :
47+ for d in deps :
48+ lines .append (f'- { t } -> { d } ' )
49+
50+ if lines :
51+ return '\n ' .join (lines )
52+ else :
53+ return '<none>'
54+
4355 location = inspect .getfile (type (check ))
4456 if not detailed :
4557 return f'- { check .name } (found in { location !r} )'
@@ -52,7 +64,6 @@ def fmt_list(x):
5264 node_alloc_scheme = f'flexible (minimum { - check .num_tasks } task(s))'
5365
5466 check_info = {
55- 'Dependencies' : fmt_list ([d [0 ] for d in check .user_deps ()]),
5667 'Description' : check .descr ,
5768 'Environment modules' : fmt_list (check .modules ),
5869 'Location' : location ,
@@ -64,14 +75,18 @@ def fmt_list(x):
6475 },
6576 'Tags' : fmt_list (check .tags ),
6677 'Valid environments' : fmt_list (check .valid_prog_environs ),
67- 'Valid systems' : fmt_list (check .valid_systems )
78+ 'Valid systems' : fmt_list (check .valid_systems ),
79+ 'Dependencies (conceptual)' : fmt_list (
80+ [d [0 ] for d in check .user_deps ()]
81+ ),
82+ 'Dependencies (actual)' : fmt_deps ()
6883 }
6984 lines = [f'- { check .name } :' ]
7085 for prop , val in check_info .items ():
7186 lines .append (f' { prop } :' )
7287 if isinstance (val , dict ):
7388 for k , v in val .items ():
74- lines .append (f' { k } : { v } ' )
89+ lines .append (f' - { k } : { v } ' )
7590 else :
7691 lines .append (f' { val } ' )
7792
@@ -88,9 +103,19 @@ def format_env(envvars):
88103 return ret
89104
90105
91- def list_checks (checks , printer , detailed = False ):
106+ def list_checks (testcases , printer , detailed = False ):
92107 printer .info ('[List of matched checks]' )
93- printer .info ('\n ' .join (format_check (c , detailed ) for c in checks ))
108+
109+ # Collect dependencies per test
110+ deps = {}
111+ for t in testcases :
112+ deps .setdefault (t .check .name , [])
113+ deps [t .check .name ].append ((t , t .deps ))
114+
115+ checks = set (t .check for t in testcases )
116+ printer .info (
117+ '\n ' .join (format_check (c , deps [c .name ], detailed ) for c in checks )
118+ )
94119 printer .info (f'Found { len (checks )} check(s)' )
95120
96121
@@ -715,7 +740,7 @@ def print_infoline(param, value):
715740 # Act on checks
716741 success = True
717742 if options .list or options .list_detailed :
718- list_checks (checks_matched , printer , options .list_detailed )
743+ list_checks (testcases , printer , options .list_detailed )
719744 elif options .run :
720745 # Setup the execution policy
721746 if options .exec_policy == 'serial' :
0 commit comments