@@ -197,15 +197,17 @@ def _decorateTest(
197197):
198198 def fn (self ):
199199 skip_for_os = _match_decorator_property (
200- lldbplatform .translate (oslist ), self .getPlatform ()
200+ lldbplatform .translate (oslist ), lldbplatformutil .getPlatform ()
201201 )
202202 skip_for_hostos = _match_decorator_property (
203203 lldbplatform .translate (hostoslist ), lldbplatformutil .getHostPlatform ()
204204 )
205205 skip_for_compiler = _match_decorator_property (
206- compiler , self .getCompiler ()
207- ) and self .expectedCompilerVersion (compiler_version )
208- skip_for_arch = _match_decorator_property (archs , self .getArchitecture ())
206+ compiler , lldbplatformutil .getCompiler ()
207+ ) and lldbplatformutil .expectedCompilerVersion (compiler_version )
208+ skip_for_arch = _match_decorator_property (
209+ archs , lldbplatformutil .getArchitecture ()
210+ )
209211 skip_for_debug_info = _match_decorator_property (debug_info , self .getDebugInfo ())
210212 skip_for_triple = _match_decorator_property (
211213 triple , lldb .selected_platform .GetTriple ()
@@ -236,7 +238,7 @@ def fn(self):
236238 )
237239 skip_for_dwarf_version = (dwarf_version is None ) or (
238240 _check_expected_version (
239- dwarf_version [0 ], dwarf_version [1 ], self .getDwarfVersion ()
241+ dwarf_version [0 ], dwarf_version [1 ], lldbplatformutil .getDwarfVersion ()
240242 )
241243 )
242244 skip_for_setting = (setting is None ) or (setting in configuration .settings )
@@ -375,7 +377,9 @@ def skipIf(
375377def _skip_for_android (reason , api_levels , archs ):
376378 def impl (obj ):
377379 result = lldbplatformutil .match_android_device (
378- obj .getArchitecture (), valid_archs = archs , valid_api_levels = api_levels
380+ lldbplatformutil .getArchitecture (),
381+ valid_archs = archs ,
382+ valid_api_levels = api_levels ,
379383 )
380384 return reason if result else None
381385
@@ -537,7 +541,10 @@ def wrapper(*args, **kwargs):
537541
538542def expectedFlakeyOS (oslist , bugnumber = None , compilers = None ):
539543 def fn (self ):
540- return self .getPlatform () in oslist and self .expectedCompiler (compilers )
544+ return (
545+ lldbplatformutil .getPlatform () in oslist
546+ and lldbplatformutil .expectedCompiler (compilers )
547+ )
541548
542549 return expectedFlakey (fn , bugnumber )
543550
@@ -618,9 +625,11 @@ def are_sb_headers_missing():
618625def skipIfRosetta (bugnumber ):
619626 """Skip a test when running the testsuite on macOS under the Rosetta translation layer."""
620627
621- def is_running_rosetta (self ):
628+ def is_running_rosetta ():
622629 if lldbplatformutil .getPlatform () in ["darwin" , "macosx" ]:
623- if (platform .uname ()[5 ] == "arm" ) and (self .getArchitecture () == "x86_64" ):
630+ if (platform .uname ()[5 ] == "arm" ) and (
631+ lldbplatformutil .getArchitecture () == "x86_64"
632+ ):
624633 return "skipped under Rosetta"
625634 return None
626635
@@ -694,7 +703,7 @@ def skipIfWindows(func):
694703def skipIfWindowsAndNonEnglish (func ):
695704 """Decorate the item to skip tests that should be skipped on non-English locales on Windows."""
696705
697- def is_Windows_NonEnglish (self ):
706+ def is_Windows_NonEnglish ():
698707 if sys .platform != "win32" :
699708 return None
700709 kernel = ctypes .windll .kernel32
@@ -724,11 +733,15 @@ def skipUnlessTargetAndroid(func):
724733def skipIfHostIncompatibleWithRemote (func ):
725734 """Decorate the item to skip tests if binaries built on this host are incompatible."""
726735
727- def is_host_incompatible_with_remote (self ):
728- host_arch = self . getLldbArchitecture ()
736+ def is_host_incompatible_with_remote ():
737+ host_arch = lldbplatformutil . getLLDBArchitecture ()
729738 host_platform = lldbplatformutil .getHostPlatform ()
730- target_arch = self .getArchitecture ()
731- target_platform = "darwin" if self .platformIsDarwin () else self .getPlatform ()
739+ target_arch = lldbplatformutil .getArchitecture ()
740+ target_platform = (
741+ "darwin"
742+ if lldbplatformutil .platformIsDarwin ()
743+ else lldbplatformutil .getPlatform ()
744+ )
732745 if (
733746 not (target_arch == "x86_64" and host_arch == "i386" )
734747 and host_arch != target_arch
@@ -771,8 +784,8 @@ def skipUnlessPlatform(oslist):
771784def skipUnlessArch (arch ):
772785 """Decorate the item to skip tests unless running on the specified architecture."""
773786
774- def arch_doesnt_match (self ):
775- target_arch = self .getArchitecture ()
787+ def arch_doesnt_match ():
788+ target_arch = lldbplatformutil .getArchitecture ()
776789 if arch != target_arch :
777790 return "Test only runs on " + arch + ", but target arch is " + target_arch
778791 return None
@@ -797,8 +810,8 @@ def skipIfTargetAndroid(bugnumber=None, api_levels=None, archs=None):
797810def skipUnlessAppleSilicon (func ):
798811 """Decorate the item to skip tests unless running on Apple Silicon."""
799812
800- def not_apple_silicon (test ):
801- if platform .system () != "Darwin" or test .getArchitecture () not in [
813+ def not_apple_silicon ():
814+ if platform .system () != "Darwin" or lldbplatformutil .getArchitecture () not in [
802815 "arm64" ,
803816 "arm64e" ,
804817 ]:
@@ -811,10 +824,10 @@ def not_apple_silicon(test):
811824def skipUnlessSupportedTypeAttribute (attr ):
812825 """Decorate the item to skip test unless Clang supports type __attribute__(attr)."""
813826
814- def compiler_doesnt_support_struct_attribute (self ):
815- compiler_path = self .getCompiler ()
827+ def compiler_doesnt_support_struct_attribute ():
828+ compiler_path = lldbplatformutil .getCompiler ()
816829 f = tempfile .NamedTemporaryFile ()
817- cmd = [self .getCompiler (), "-x" , "c++" , "-c" , "-o" , f .name , "-" ]
830+ cmd = [lldbplatformutil .getCompiler (), "-x" , "c++" , "-c" , "-o" , f .name , "-" ]
818831 p = subprocess .Popen (
819832 cmd ,
820833 stdin = subprocess .PIPE ,
@@ -833,8 +846,8 @@ def compiler_doesnt_support_struct_attribute(self):
833846def skipUnlessHasCallSiteInfo (func ):
834847 """Decorate the function to skip testing unless call site info from clang is available."""
835848
836- def is_compiler_clang_with_call_site_info (self ):
837- compiler_path = self .getCompiler ()
849+ def is_compiler_clang_with_call_site_info ():
850+ compiler_path = lldbplatformutil .getCompiler ()
838851 compiler = os .path .basename (compiler_path )
839852 if not compiler .startswith ("clang" ):
840853 return "Test requires clang as compiler"
@@ -861,18 +874,21 @@ def is_compiler_clang_with_call_site_info(self):
861874def skipUnlessThreadSanitizer (func ):
862875 """Decorate the item to skip test unless Clang -fsanitize=thread is supported."""
863876
864- def is_compiler_clang_with_thread_sanitizer (self ):
877+ def is_compiler_clang_with_thread_sanitizer ():
865878 if is_running_under_asan ():
866879 return "Thread sanitizer tests are disabled when runing under ASAN"
867880
868- compiler_path = self .getCompiler ()
881+ compiler_path = lldbplatformutil .getCompiler ()
869882 compiler = os .path .basename (compiler_path )
870883 if not compiler .startswith ("clang" ):
871884 return "Test requires clang as compiler"
872885 if lldbplatformutil .getPlatform () == "windows" :
873886 return "TSAN tests not compatible with 'windows'"
874887 # rdar://28659145 - TSAN tests don't look like they're supported on i386
875- if self .getArchitecture () == "i386" and platform .system () == "Darwin" :
888+ if (
889+ lldbplatformutil .getArchitecture () == "i386"
890+ and platform .system () == "Darwin"
891+ ):
876892 return "TSAN tests not compatible with i386 targets"
877893 if not _compiler_supports (compiler_path , "-fsanitize=thread" ):
878894 return "Compiler cannot compile with -fsanitize=thread"
@@ -884,7 +900,7 @@ def is_compiler_clang_with_thread_sanitizer(self):
884900def skipUnlessUndefinedBehaviorSanitizer (func ):
885901 """Decorate the item to skip test unless -fsanitize=undefined is supported."""
886902
887- def is_compiler_clang_with_ubsan (self ):
903+ def is_compiler_clang_with_ubsan ():
888904 if is_running_under_asan ():
889905 return (
890906 "Undefined behavior sanitizer tests are disabled when runing under ASAN"
@@ -895,7 +911,7 @@ def is_compiler_clang_with_ubsan(self):
895911
896912 # Try to compile with ubsan turned on.
897913 if not _compiler_supports (
898- self .getCompiler (),
914+ lldbplatformutil .getCompiler (),
899915 "-fsanitize=undefined" ,
900916 "int main() { int x = 0; return x / x; }" ,
901917 outputf ,
@@ -910,7 +926,10 @@ def is_compiler_clang_with_ubsan(self):
910926
911927 # Find the ubsan dylib.
912928 # FIXME: This check should go away once compiler-rt gains support for __ubsan_on_report.
913- cmd = "%s -fsanitize=undefined -x c - -o - -### 2>&1" % self .getCompiler ()
929+ cmd = (
930+ "%s -fsanitize=undefined -x c - -o - -### 2>&1"
931+ % lldbplatformutil .getCompiler ()
932+ )
914933 with os .popen (cmd ) as cc_output :
915934 driver_jobs = cc_output .read ()
916935 m = re .search (r'"([^"]+libclang_rt.ubsan_osx_dynamic.dylib)"' , driver_jobs )
@@ -942,7 +961,7 @@ def is_running_under_asan():
942961def skipUnlessAddressSanitizer (func ):
943962 """Decorate the item to skip test unless Clang -fsanitize=thread is supported."""
944963
945- def is_compiler_with_address_sanitizer (self ):
964+ def is_compiler_with_address_sanitizer ():
946965 # Also don't run tests that use address sanitizer inside an
947966 # address-sanitized LLDB. The tests don't support that
948967 # configuration.
@@ -951,7 +970,7 @@ def is_compiler_with_address_sanitizer(self):
951970
952971 if lldbplatformutil .getPlatform () == "windows" :
953972 return "ASAN tests not compatible with 'windows'"
954- if not _compiler_supports (self .getCompiler (), "-fsanitize=address" ):
973+ if not _compiler_supports (lldbplatformutil .getCompiler (), "-fsanitize=address" ):
955974 return "Compiler cannot compile with -fsanitize=address"
956975 return None
957976
@@ -966,8 +985,8 @@ def skipIfAsan(func):
966985def skipUnlessAArch64MTELinuxCompiler (func ):
967986 """Decorate the item to skip test unless MTE is supported by the test compiler."""
968987
969- def is_toolchain_with_mte (self ):
970- compiler_path = self .getCompiler ()
988+ def is_toolchain_with_mte ():
989+ compiler_path = lldbplatformutil .getCompiler ()
971990 compiler = os .path .basename (compiler_path )
972991 f = tempfile .NamedTemporaryFile ()
973992 if lldbplatformutil .getPlatform () == "windows" :
@@ -1053,7 +1072,7 @@ def skipIfLLVMTargetMissing(target):
10531072
10541073# Call sysctl on darwin to see if a specified hardware feature is available on this machine.
10551074def skipUnlessFeature (feature ):
1056- def is_feature_enabled (self ):
1075+ def is_feature_enabled ():
10571076 if platform .system () == "Darwin" :
10581077 try :
10591078 DEVNULL = open (os .devnull , "w" )
0 commit comments