[Lldb-commits] [PATCH] Documentation for test timeout

Chaoren Lin chaorenl at google.com
Mon Dec 15 16:19:02 PST 2014


Hi vharron, zturner,

Moved the timeout documentation to the correct location, and added it to the help string. Also forgot to check for the no timeout case.

Should subsequent lines of the help string be indented?

http://reviews.llvm.org/D6669

Files:
  test/dosep.py

Index: test/dosep.py
===================================================================
--- test/dosep.py
+++ test/dosep.py
@@ -2,6 +2,16 @@
 
 """
 Run the test suite using a separate process for each test file.
+
+Each test will run with a time limit of 5 minutes by default.
+
+Override the default time limit of 5 minutes with LLDB_TEST_TIMEOUT.
+E.g., LLDB_TEST_TIMEOUT=10m
+
+Override the time limit for individual tests with LLDB_[TEST NAME]_TIMEOUT.
+E.g., LLDB_TESTCONCURRENTEVENTS_TIMEOUT=2m
+
+Set to "0" to run without time limit.
 """
 
 import multiprocessing
@@ -14,6 +24,7 @@
 from optparse import OptionParser
 
 def get_timeout_command():
+    """Search for a suitable timeout command."""
     if sys.platform.startswith("win32"):
         return None
     try:
@@ -35,13 +46,8 @@
 eTimedOut, ePassed, eFailed = 124, 0, 1
 
 def call_with_timeout(command, timeout):
-    """Each test will timeout after 5 minutes by default.
-    Override the default timeout of 5 minutes with LLDB_TEST_TIMEOUT.
-    E.g., LLDB_TEST_TIMEOUT=10m
-    Override the timeout for individual tests with LLDB_[TEST NAME]_TIMEOUT.
-    E.g., LLDB_TESTCONCURRENTEVENTS_TIMEOUT=2m
-    Set to "0" to run without timeout."""
-    if timeout_command:
+    """Run command with a timeout if possible."""
+    if timeout_command and timeout != "0":
         return subprocess.call([timeout_command, timeout] + command,
                                stdin=subprocess.PIPE)
     return (ePassed if subprocess.call(command, stdin=subprocess.PIPE) == 0
@@ -128,6 +134,16 @@
 
     parser = OptionParser(usage="""\
 Run lldb test suite using a separate process for each test file.
+
+       Each test will run with a time limit of 5 minutes by default.
+
+       Override the default time limit of 5 minutes with LLDB_TEST_TIMEOUT.
+       E.g., LLDB_TEST_TIMEOUT=10m
+
+       Override the time limit for individual tests with LLDB_[TEST NAME]_TIMEOUT.
+       E.g., LLDB_TESTCONCURRENTEVENTS_TIMEOUT=2m
+
+       Set to "0" to run without time limit.
 """)
     parser.add_option('-o', '--options',
                       type='string', action='store',

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6669.17310.patch
Type: text/x-patch
Size: 2140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20141216/1d389099/attachment.bin>


More information about the lldb-commits mailing list