[Lldb-commits] [PATCH] D133075: Fix lldb-dotest when dotest_args_str is empty

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 31 17:27:53 PDT 2022


jingham created this revision.
jingham added reviewers: JDevlieghere, kastiglione, aprantl, labath.
Herald added a project: All.
jingham requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

When - after substitution - the dotest_args_str is empty, then we were still inserting the blank string into the args.  Later on, a blank arg is taken to be a directory path and gets added to the CWD (which is generally in the build directory) and then none of the actual test directories match that, so we find no tests.

This patch fixes that by not adding blank arguments in lldb-dotest.

It could also be fixed by having the dotest implementation discard empty arguments, but I wasn't sure that was always correct, maybe you are somewhere in the test suite already and want to pass "" to dial up the current directory?  So I went with fixing it where we were getting it wrong instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133075

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


Index: lldb/utils/lldb-dotest/lldb-dotest.in
===================================================================
--- lldb/utils/lldb-dotest/lldb-dotest.in
+++ lldb/utils/lldb-dotest/lldb-dotest.in
@@ -20,7 +20,10 @@
     # Build dotest.py command.
     cmd = [sys.executable, dotest_path]
     cmd.extend(['--arch', arch])
-    cmd.extend(dotest_args)
+    # Don't stick empty args into the command, they will get interpreted as
+    # test path directories and override the default searching.
+    if len(dotest_args) > 0:
+        cmd.extend(dotest_args)
     cmd.extend(['--build-dir', lldb_build_dir])
     cmd.extend(['--executable', executable])
     cmd.extend(['--compiler', compiler])


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133075.457137.patch
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220901/b74d524d/attachment.bin>


More information about the lldb-commits mailing list