[lldb][test] Enable TestExpressionInSyscall.py on Windows Relates to https://github.com/llvm/llvm-project/issues/22139 Just had to use the right win32 call instead of getpid. The original problem was something with expressions in general which was fixed at some point. Also make the test one method, there's no need to split it up.
diff --git a/lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py b/lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py index 9f98489..c229875 100644 --- a/lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py +++ b/lldb/test/API/commands/expression/expr-in-syscall/TestExpressionInSyscall.py
@@ -7,16 +7,10 @@ class ExprSyscallTestCase(TestBase): - @expectedFailureAll( - oslist=["windows"], - bugnumber="llvm.org/pr21765, getpid() does not exist on Windows", - ) @expectedFailureNetBSD def test_setpgid(self): self.build() - self.expr_syscall() - def expr_syscall(self): # Create a target by the debugger. target = self.createTestTarget() @@ -65,7 +59,12 @@ # try evaluating a couple of expressions in this state self.expect_expr("release_flag = 1", result_value="1") - self.expect_expr("(int)getpid()", result_value=str(process.GetProcessID())) + func = ( + "GetCurrentProcessId" + if lldbplatformutil.getPlatform() == "windows" + else "getpid" + ) + self.expect_expr(f"(int){func}()", result_value=str(process.GetProcessID())) # and run the process to completion process.Continue()