diff --git a/reframe/frontend/argparse.py b/reframe/frontend/argparse.py index 5cf672fa47..67f0bce3ab 100644 --- a/reframe/frontend/argparse.py +++ b/reframe/frontend/argparse.py @@ -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( @@ -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 diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index 359c77fb77..6773542eab 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -53,6 +53,14 @@ def format_check(check, detailed): return '\n'.join(lines) +def format_env(envvars): + ret = '[ReFrame Environment]\n' + notset = '' + 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: @@ -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 + ':'