Files
clang-p2996/lldb/test/API/lang/objc/orderedset/TestOrderedSet.py
Vladislav Dzhidzhoev 44fc987ed1 [lldb][test] Toolchain detection rewrite in Python (#102185)
This fix is based on a problem with cxx_compiler and cxx_linker macros
on Windows.
There was an issue with compiler detection in paths containing "icc". In
such case, Makefile.rules thought it was provided with icc compiler.

To solve that, utilities detection has been rewritten in Python.
The last element of compiler's path is separated, taking into account
the platform path delimiter, and compiler type is extracted, with regard
of possible cross-toolchain prefix.

---------

Co-authored-by: Pavel Labath <pavel@labath.sk>
2024-09-11 16:04:01 +03:00

34 lines
1.1 KiB
Python

import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestOrderedSet(TestBase):
def test_ordered_set(self):
self.build()
self.run_tests()
@skipUnlessDarwin
def test_ordered_set_no_const(self):
disable_constant_classes = {
"CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals "
+ "-fno-constant-nsarray-literals "
+ "-fno-constant-nsdictionary-literals",
}
# FIXME: Remove when flags are available upstream.
self.build(dictionary=disable_constant_classes, compiler="xcrun clang")
self.run_tests()
def run_tests(self):
src_file = "main.m"
src_file_spec = lldb.SBFileSpec(src_file)
(target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(
self, "break here", src_file_spec, exe_name="a.out"
)
frame = thread.GetSelectedFrame()
self.expect("expr -d run -- orderedSet", substrs=["3 elements"])
self.expect(
"expr -d run -- *orderedSet", substrs=["(int)1", "(int)2", "(int)3"]
)