File: HideTestFailures.py

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (78 lines) | stat: -rw-r--r-- 2,683 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""
Test that variables of integer basic types are displayed correctly.
"""



import AbstractBase
import lldb
from lldbsuite.test.lldbtest import *

# rdar://problem/9649573
# Capture the lldb and gdb-remote log files for test failures when run
# with no "-w" option


class DebugIntegerTypesFailures(TestBase):

    mydir = TestBase.compute_mydir(__file__)

    def setUp(self):
        # Call super's setUp().
        TestBase.setUp(self)
        # If we're lucky, test_long_type_with_dsym fails.
        # Let's turn on logging just for that.
        try:
            if "test_long_type_with_dsym" in self.id():
                self.runCmd(
                    "log enable -n -f %s lldb commands event process state" %
                    os.environ["DEBUG_LLDB_LOG"])
                self.runCmd(
                    "log enable -n -f %s gdb-remote packets process" %
                    os.environ["DEBUG_GDB_REMOTE_LOG"])
        except:
            pass

    def tearDown(self):
        # If we're lucky, test_long_type_with_dsym fails.
        # Let's turn off logging just for that.
        if "test_long_type_with_dsym" in self.id():
            self.runCmd("log disable lldb")
            self.runCmd("log disable gdb-remote")
        # Call super's tearDown().
        TestBase.tearDown(self)

    def test_char_type(self):
        """Test that char-type variables are displayed correctly."""
        d = {'CXX_SOURCES': 'char.cpp'}
        self.build(dictionary=d)
        self.setTearDownCleanup(dictionary=d)
        self.generic_type_tester(set(['char']), quotedDisplay=True)

    def test_short_type(self):
        """Test that short-type variables are displayed correctly."""
        d = {'CXX_SOURCES': 'short.cpp'}
        self.build(dictionary=d)
        self.setTearDownCleanup(dictionary=d)
        self.generic_type_tester(set(['short']))

    def test_int_type(self):
        """Test that int-type variables are displayed correctly."""
        d = {'CXX_SOURCES': 'int.cpp'}
        self.build(dictionary=d)
        self.setTearDownCleanup(dictionary=d)
        self.generic_type_tester(set(['int']))

    def test_long_type(self):
        """Test that long-type variables are displayed correctly."""
        d = {'CXX_SOURCES': 'long.cpp'}
        self.build(dictionary=d)
        self.setTearDownCleanup(dictionary=d)
        self.generic_type_tester(set(['long']))

    def test_long_long_type(self):
        """Test that 'long long'-type variables are displayed correctly."""
        d = {'CXX_SOURCES': 'long_long.cpp'}
        self.build(dictionary=d)
        self.setTearDownCleanup(dictionary=d)
        self.generic_type_tester(set(['long long']))