Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 14 additions & 8 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,26 @@ def dep_lines(u, *, prefix, depth=0, lines=None, printed=None,

adj = u.deps
for v in adj:
key = f'{type(v.check).__name__}#{v.check._rfm_fixt_data.scope}'
if v.check.is_fixture():
fixture_scope = v.check._rfm_fixt_data.scope
key = f'{type(v.check).__name__}#{fixture_scope}'
fixture_vars = fixt_to_vars[key]
else:
fixture_vars = None
unique_checks.add(v.check.unique_name)

if concretized or (not concretized and
v.check.unique_name not in printed):
dep_lines(v, prefix=prefix + 2*' ', depth=depth+1,
lines=lines, printed=printed,
fixt_vars=fixt_to_vars[key])

printed.add(v.check.unique_name)
if not v.check.is_fixture():
unique_checks.add(v.check.unique_name)
fixt_vars=fixture_vars)

if depth:
fmt_fixt_vars = " '"
fmt_fixt_vars += " '".join(fixt_vars)
if fixt_vars:
fmt_fixt_vars = " '"
fmt_fixt_vars += " '".join(fixt_vars)
else:
fmt_fixt_vars = ''

name_info = f'{u.check.display_name}{fmt_fixt_vars} /{u.check.hashcode}'
tc_info = ''
Expand Down
22 changes: 22 additions & 0 deletions unittests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,28 @@ def test_list_tags(run_reframe):
assert returncode == 0


def test_list_tests_with_deps(run_reframe):
returncode, stdout, _ = run_reframe(
system='sys0',
checkpath=['unittests/resources/checks_unlisted/deps_simple.py'],
action='list',
environs=[]
)
assert 'Found 9 check(s)' in stdout
assert returncode == 0


def test_list_tests_with_fixtures(run_reframe):
returncode, stdout, _ = run_reframe(
system='sys0',
checkpath=['unittests/resources/checks_unlisted/fixtures_simple.py'],
action='list',
environs=[]
)
assert 'Found 3 check(s)' in stdout
assert returncode == 0


def test_filtering_multiple_criteria_name(run_reframe):
returncode, stdout, stderr = run_reframe(
checkpath=['unittests/resources/checks'],
Expand Down