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
3 changes: 3 additions & 0 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ def main():
"`--keep-stage-files' option.")
sys.exit(1)

if options.timestamp:
rt.resources.timefmt = options.timestamp

# Setup the check loader
if options.checkpath:
load_path = []
Expand Down
14 changes: 13 additions & 1 deletion unittests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def run_command_inline(argv, funct, *args, **kwargs):

captured_stdout = StringIO()
captured_stderr = StringIO()
print(sys.argv)
with redirect_stdout(captured_stdout):
with redirect_stderr(captured_stderr):
try:
Expand Down Expand Up @@ -305,3 +304,16 @@ def test_no_ignore_check_conflicts(self):
self.action = 'list'
returncode, *_ = self._run_reframe()
self.assertNotEqual(0, returncode)

def test_timestamp_option(self):
from datetime import datetime

self.checkpath = ['unittests/resources/checks']
self.more_options = ['-R']
self.ignore_check_conflicts = False
self.action = 'list'
self.more_options = ['--timestamp=xxx_%F']
timefmt = datetime.now().strftime('xxx_%F')
returncode, stdout, _ = self._run_reframe()
self.assertNotEqual(0, returncode)
self.assertIn(timefmt, stdout)