Skip to content

[lldb] Provide an unconditional @skip annotation for API tests #137712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

JDevlieghere
Copy link
Member

The correct way of doing this today is to use @skipIf with no arguments, which reads like it expects a condition.

Fixes #137710

The correct way of doing this today is to use `@skipIf` with no
arguments, which reads like it expects a condition.

Fixes llvm#137710
@llvmbot
Copy link
Member

llvmbot commented Apr 28, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

The correct way of doing this today is to use @<!-- -->skipIf with no arguments, which reads like it expects a condition.

Fixes #137710


Full diff: https://github.com/llvm/llvm-project/pull/137712.diff

5 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/decorators.py (+4)
  • (modified) lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py (+1-1)
  • (modified) lldb/test/API/commands/watchpoints/variable_out_of_scope/TestWatchedVarHitWhenInScope.py (+1-1)
  • (modified) lldb/test/API/lang/objc/bitfield_ivars/TestBitfieldIvars.py (+1-1)
  • (modified) lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py (+1-1)
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index c48c0b2f77944..895f2a82547a9 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -397,6 +397,10 @@ def skipIf(
     )
 
 
+def skip(bugnumber=None):
+    return _decorateTest(DecorateMode.Skip, bugnumber=bugnumber)
+
+
 def _skip_fn_for_android(reason, api_levels, archs):
     def impl():
         result = lldbplatformutil.match_android_device(
diff --git a/lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
index bd3d47c27ac90..2d314ec2582c3 100644
--- a/lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
@@ -13,7 +13,7 @@ class TestCase(TestBase):
     # FIXME: This regressed in 69d5a6662115499198ebfa07a081e98a6ce4b915
     # but needs further investigation for what underlying Clang/LLDB bug can't
     # handle that code change.
-    @skipIf
+    @skip
     def test(self):
         self.build()
 
diff --git a/lldb/test/API/commands/watchpoints/variable_out_of_scope/TestWatchedVarHitWhenInScope.py b/lldb/test/API/commands/watchpoints/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
index 4580759b2747c..4f6505ef0864f 100644
--- a/lldb/test/API/commands/watchpoints/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
+++ b/lldb/test/API/commands/watchpoints/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
@@ -28,7 +28,7 @@ def setUp(self):
 
     # Test hangs due to a kernel bug, see fdfeff0f in the linux kernel for details
     @skipIfTargetAndroid(api_levels=list(range(25 + 1)), archs=["aarch64", "arm"])
-    @skipIf
+    @skip
     def test_watched_var_should_only_hit_when_in_scope(self):
         """Test that a variable watchpoint should only hit when in scope."""
         self.build(dictionary=self.d)
diff --git a/lldb/test/API/lang/objc/bitfield_ivars/TestBitfieldIvars.py b/lldb/test/API/lang/objc/bitfield_ivars/TestBitfieldIvars.py
index 555fec305dbc0..d9f95aeee0cbd 100644
--- a/lldb/test/API/lang/objc/bitfield_ivars/TestBitfieldIvars.py
+++ b/lldb/test/API/lang/objc/bitfield_ivars/TestBitfieldIvars.py
@@ -42,7 +42,7 @@ def test(self):
 
     # This test is meant to be xfailed, but running the test triggers an ASan
     # issue, so it must be skipped for now.
-    @skipIf
+    @skip
     def testExprWholeObject(self):
         self.build()
         lldbutil.run_to_source_breakpoint(
diff --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
index 9278894eefc95..18786fca5b1ef 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
@@ -19,7 +19,7 @@
 import socket
 
 
-@skipIf
+@skip
 class TestDAP_attachByPortNum(lldbdap_testcase.DAPTestCaseBase):
     default_timeout = 20
 

Copy link
Contributor

@felipepiovezan felipepiovezan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@JDevlieghere JDevlieghere merged commit 3081ec1 into llvm:main Apr 29, 2025
12 checks passed
@JDevlieghere JDevlieghere deleted the issue137710 branch April 29, 2025 15:28
felipepiovezan pushed a commit to felipepiovezan/llvm-project that referenced this pull request May 1, 2025
…137712)

The correct way of doing this today is to use `@skipIf` with no
arguments, which reads like it expects a condition.

Fixes llvm#137710

(cherry picked from commit 3081ec1)
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…137712)

The correct way of doing this today is to use `@skipIf` with no
arguments, which reads like it expects a condition.

Fixes llvm#137710
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…137712)

The correct way of doing this today is to use `@skipIf` with no
arguments, which reads like it expects a condition.

Fixes llvm#137710
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…137712)

The correct way of doing this today is to use `@skipIf` with no
arguments, which reads like it expects a condition.

Fixes llvm#137710
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
…137712)

The correct way of doing this today is to use `@skipIf` with no
arguments, which reads like it expects a condition.

Fixes llvm#137710
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
…137712)

The correct way of doing this today is to use `@skipIf` with no
arguments, which reads like it expects a condition.

Fixes llvm#137710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LLDB] Provide an unconditional @skip annotation for API tests
3 participants