Test suite support for setting arguments through the environment
Set your env variable LLDB_TEST_ARGUMENTS to one or more options to be passed to the lldb test suite and those will be picked automatically
No more fighting about whether the progress bar is good or bad :-)
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184615 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/dotest.py b/test/dotest.py
index 2d6f0b5..c7d330c 100755
--- a/test/dotest.py
+++ b/test/dotest.py
@@ -328,6 +328,9 @@
candidate = item
return candidate
+class ArgParseNamespace(object):
+ pass
+
def parseOptionsAndInitTestdirs():
"""Initialize the list of directories containing our unittest scripts.
@@ -440,7 +443,14 @@
group = parser.add_argument_group('Test directories')
group.add_argument('args', metavar='test-dir', nargs='*', help='Specify a list of directory names to search for test modules named after Test*.py (test discovery). If empty, search from the current working directory instead.')
- args = parser.parse_args()
+
+ args = ArgParseNamespace()
+
+ if ('LLDB_TEST_ARGUMENTS' in os.environ):
+ print "Arguments passed through environment: '%s'" % os.environ['LLDB_TEST_ARGUMENTS']
+ args = parser.parse_args([sys.argv[0]].__add__(os.environ['LLDB_TEST_ARGUMENTS'].split()),namespace=args)
+
+ args = parser.parse_args(namespace=args)
platform_system = platform.system()
platform_machine = platform.machine()