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
15 changes: 5 additions & 10 deletions reframe/frontend/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ def cmd_options(self):
'''Options filled in by command-line'''
return self.__namespace

@property
def env_vars(self):
'''Environment variables related to ReFrame'''
return [v[0].split()[0] for v in self.__option_map.values() if v[0]]

def __getattr__(self, name):
if name.startswith('_'):
raise AttributeError(
Expand Down Expand Up @@ -273,13 +278,3 @@ def parse_args(self, args=None, namespace=None):
)

return _Namespace(options, self._option_map)


def format_options(namespace):
'''Format parsed arguments in ``namespace``.'''
ret = 'Command-line configuration:\n'
ret += '\n'.join(
[' %s=%s' % (attr, val)
for attr, val in sorted(namespace.cmd_options.__dict__.items())]
)
return ret
11 changes: 10 additions & 1 deletion reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ def format_check(check, detailed):
return '\n'.join(lines)


def format_env(envvars):
ret = '[ReFrame Environment]\n'
notset = '<not set>'
envvars = [*envvars, 'RFM_INSTALL_PREFIX']
ret += '\n'.join(sorted(f' {e}={os.getenv(e, notset)}' for e in envvars))
return ret


def list_checks(checks, printer, detailed=False):
printer.info('[List of matched checks]')
for c in checks:
Expand Down Expand Up @@ -416,13 +424,14 @@ def main():

sys.exit(0)

printer.debug(format_env(options.env_vars))

# Setup the check loader
loader = RegressionCheckLoader(
load_path=site_config.get('general/0/check_search_path'),
recurse=site_config.get('general/0/check_search_recursive'),
ignore_conflicts=site_config.get('general/0/ignore_check_conflicts')
)
printer.debug(argparse.format_options(options))

def print_infoline(param, value):
param = param + ':'
Expand Down