llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.78k stars 11.9k forks source link

[lldb] Fixed the TestFdLeak test #92273

Closed slydiman closed 5 months ago

slydiman commented 5 months ago

Use NUL instead of /dev/null in case of the Windows host.

llvmbot commented 5 months ago

@llvm/pr-subscribers-lldb

Author: Dmitry Vasilyev (slydiman)

Changes Use `NUL` instead of `/dev/null` in case of the Windows host. --- Full diff: https://github.com/llvm/llvm-project/pull/92273.diff 1 Files Affected: - (modified) lldb/test/API/functionalities/avoids-fd-leak/TestFdLeak.py (+4-1) ``````````diff diff --git a/lldb/test/API/functionalities/avoids-fd-leak/TestFdLeak.py b/lldb/test/API/functionalities/avoids-fd-leak/TestFdLeak.py index e4f5cd3a03f86..e292885ec390d 100644 --- a/lldb/test/API/functionalities/avoids-fd-leak/TestFdLeak.py +++ b/lldb/test/API/functionalities/avoids-fd-leak/TestFdLeak.py @@ -26,7 +26,10 @@ def test_fd_leak_basic(self): @skipIfTargetAndroid() # Android have some other file descriptors open by the shell @skipIfDarwinEmbedded # # debugserver on ios has an extra fd open on launch def test_fd_leak_log(self): - self.do_test(["log enable -f '/dev/null' lldb commands"]) + if lldbplatformutil.getHostPlatform() == "windows": + self.do_test(["log enable -f 'NUL' lldb commands"]) + else: + self.do_test(["log enable -f '/dev/null' lldb commands"]) def do_test(self, commands): self.build() ``````````
slydiman commented 5 months ago

Could this use os.devnull

Sure. It is much better. I have updated the patch. Thanks.