Skip to content

Commit

Permalink
Add CLI unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarak committed Oct 3, 2023
1 parent 238edee commit 8ac0370
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions unittests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,42 @@ def test_filtering_exclude_hash(run_reframe):
assert returncode == 0


def test_filtering_cpu_only(run_reframe):
returncode, stdout, stderr = run_reframe(
checkpath=['unittests/resources/checks/hellocheck.py'],
action='list',
more_options=['--cpu-only']
)
assert 'Traceback' not in stdout
assert 'Traceback' not in stderr
assert 'Found 2 check(s)' in stdout
assert returncode == 0


def test_filtering_gpu_only(run_reframe):
returncode, stdout, stderr = run_reframe(
checkpath=['unittests/resources/checks/hellocheck.py'],
action='list',
more_options=['--gpu-only']
)
assert 'Traceback' not in stdout
assert 'Traceback' not in stderr
assert 'Found 0 check(s)' in stdout
assert returncode == 0


def test_filtering_by_expr(run_reframe):
returncode, stdout, stderr = run_reframe(
checkpath=['unittests/resources/checks/hellocheck.py'],
action='list',
more_options=['-E num_tasks==1']
)
assert 'Traceback' not in stdout
assert 'Traceback' not in stderr
assert 'Found 2 check(s)' in stdout
assert returncode == 0


def test_show_config_all(run_reframe):
# Just make sure that this option does not make the frontend crash
returncode, stdout, stderr = run_reframe(
Expand Down

0 comments on commit 8ac0370

Please sign in to comment.