[Lldb-commits] [PATCH] D14488: Add --curses shortcut for specifying the curses-based test results formatter.
Todd Fiala via lldb-commits
lldb-commits at lists.llvm.org
Sun Nov 8 11:42:29 PST 2015
tfiala created this revision.
tfiala added a reviewer: clayborg.
tfiala added a subscriber: lldb-commits.
This shortcut is equivalent to specifying:
--results-formatter lldbsuite.test.curses_results.Curses
--results-file stdout (or --results-file /dev/stdout on some systems)
The change adds the --curses shortcut, documenting in the test results argument group. It also ensures the --curses option is removed when running the dotest.py inferiors.
The change also removes a duplicate 'import sys' found while I prepared this.
http://reviews.llvm.org/D14488
Files:
packages/Python/lldbsuite/test/dosep.py
packages/Python/lldbsuite/test/dotest.py
packages/Python/lldbsuite/test/dotest_args.py
Index: packages/Python/lldbsuite/test/dotest_args.py
===================================================================
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -151,6 +151,10 @@
# Test results support.
group = parser.add_argument_group('Test results options')
group.add_argument(
+ '--curses',
+ action='store_true',
+ help='Shortcut for specifying test results using the curses formatter')
+ group.add_argument(
'--results-file',
action='store',
help=('Specifies the file where test results will be written '
Index: packages/Python/lldbsuite/test/dotest.py
===================================================================
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -22,7 +22,6 @@
from __future__ import print_function
# System modules
-import sys
import atexit
import importlib
import os
@@ -751,6 +750,11 @@
test_runner_name = args.test_runner_name
# Capture test results-related args.
+ if args.curses and not args.inferior:
+ # Act as if the following args were set.
+ args.results_formatter = "lldbsuite.test.curses_results.Curses"
+ args.results_file = "stdout"
+
if args.results_file:
results_filename = args.results_file
Index: packages/Python/lldbsuite/test/dosep.py
===================================================================
--- packages/Python/lldbsuite/test/dosep.py
+++ packages/Python/lldbsuite/test/dosep.py
@@ -1227,6 +1227,10 @@
_remove_option(dotest_argv, "--results-formatter-option", "-O",
True)
+ # Remove the --curses shortcut if specified.
+ if dotest_options.curses:
+ _remove_option(dotest_argv, "--curses", None, False)
+
# Remove test runner name if present.
if dotest_options.test_runner_name is not None:
_remove_option(dotest_argv, "--test-runner-name", None, True)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14488.39654.patch
Type: text/x-patch
Size: 2018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151108/93159b7a/attachment.bin>
More information about the lldb-commits
mailing list