xref: /llvm-project/lldb/test/API/types/HideTestFailures.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1"""
2Test that variables of integer basic types are displayed correctly.
3"""
4
5
6import AbstractBase
7import lldb
8from lldbsuite.test.lldbtest import *
9
10# rdar://problem/9649573
11# Capture the lldb and gdb-remote log files for test failures when run
12# with no "-w" option
13
14
15class DebugIntegerTypesFailures(TestBase):
16    def setUp(self):
17        # Call super's setUp().
18        TestBase.setUp(self)
19        # If we're lucky, test_long_type_with_dsym fails.
20        # Let's turn on logging just for that.
21        try:
22            if "test_long_type_with_dsym" in self.id():
23                self.runCmd(
24                    "log enable -n -f %s lldb commands event process state"
25                    % os.environ["DEBUG_LLDB_LOG"]
26                )
27                self.runCmd(
28                    "log enable -n -f %s gdb-remote packets process"
29                    % os.environ["DEBUG_GDB_REMOTE_LOG"]
30                )
31        except:
32            pass
33
34    def tearDown(self):
35        # If we're lucky, test_long_type_with_dsym fails.
36        # Let's turn off logging just for that.
37        if "test_long_type_with_dsym" in self.id():
38            self.runCmd("log disable lldb")
39            self.runCmd("log disable gdb-remote")
40        # Call super's tearDown().
41        TestBase.tearDown(self)
42
43    def test_char_type(self):
44        """Test that char-type variables are displayed correctly."""
45        d = {"CXX_SOURCES": "char.cpp"}
46        self.build(dictionary=d)
47        self.setTearDownCleanup(dictionary=d)
48        self.generic_type_tester(set(["char"]), quotedDisplay=True)
49
50    def test_short_type(self):
51        """Test that short-type variables are displayed correctly."""
52        d = {"CXX_SOURCES": "short.cpp"}
53        self.build(dictionary=d)
54        self.setTearDownCleanup(dictionary=d)
55        self.generic_type_tester(set(["short"]))
56
57    def test_int_type(self):
58        """Test that int-type variables are displayed correctly."""
59        d = {"CXX_SOURCES": "int.cpp"}
60        self.build(dictionary=d)
61        self.setTearDownCleanup(dictionary=d)
62        self.generic_type_tester(set(["int"]))
63
64    def test_long_type(self):
65        """Test that long-type variables are displayed correctly."""
66        d = {"CXX_SOURCES": "long.cpp"}
67        self.build(dictionary=d)
68        self.setTearDownCleanup(dictionary=d)
69        self.generic_type_tester(set(["long"]))
70
71    def test_long_long_type(self):
72        """Test that 'long long'-type variables are displayed correctly."""
73        d = {"CXX_SOURCES": "long_long.cpp"}
74        self.build(dictionary=d)
75        self.setTearDownCleanup(dictionary=d)
76        self.generic_type_tester(set(["long long"]))
77