[Lldb-commits] [lldb] a2670b9 - Fix a bug in lldb-dotest that was uncovered by setting no value for dotest_args_str.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 31 18:03:12 PDT 2022


Author: Jim Ingham
Date: 2022-08-31T18:00:18-07:00
New Revision: a2670b92a2542a9bb889db81ba0cf5a21b3240ee

URL: https://github.com/llvm/llvm-project/commit/a2670b92a2542a9bb889db81ba0cf5a21b3240ee
DIFF: https://github.com/llvm/llvm-project/commit/a2670b92a2542a9bb889db81ba0cf5a21b3240ee.diff

LOG: Fix a bug in lldb-dotest that was uncovered by setting no value for dotest_args_str.
We were splitting the string, and adding that array to cmd.  But split generated
[''] which shows up later on as an empty "test directory search path".  That got
extended to the CWD + "" which generally doesn't have any tests, so

lldb-dotest -p SomeRealTest.py

would fail with a no matching tests error.

Differential Revision: https://reviews.llvm.org/D133075

Added: 
    

Modified: 
    lldb/utils/lldb-dotest/lldb-dotest.in

Removed: 
    


################################################################################
diff  --git a/lldb/utils/lldb-dotest/lldb-dotest.in b/lldb/utils/lldb-dotest/lldb-dotest.in
index f6b5e0d01dcfa..896cc13913539 100755
--- a/lldb/utils/lldb-dotest/lldb-dotest.in
+++ b/lldb/utils/lldb-dotest/lldb-dotest.in
@@ -16,7 +16,11 @@ llvm_tools_dir = "@LLVM_TOOLS_DIR_CONFIGURED@"
 
 if __name__ == '__main__':
     wrapper_args = sys.argv[1:]
-    dotest_args = dotest_args_str.split(';')
+    dotest_args = []
+    # split on an empty string will produce [''] and if you
+    # add that to the command, it will be treated as a directory...
+    if len(dotest_args_str) > 0:
+        dotest_args = dotest_args_str.split(';')
     # Build dotest.py command.
     cmd = [sys.executable, dotest_path]
     cmd.extend(['--arch', arch])


        


More information about the lldb-commits mailing list