forked from OSchip/llvm-project
Rename all functionalities/data-formatter test case with radar bug numbers in them to more meaningful names
llvm-svn: 245993
This commit is contained in:
parent
beb3a9a970
commit
54ed7e18f2
|
@ -8,9 +8,8 @@ import lldb
|
|||
from lldbtest import *
|
||||
import lldbutil
|
||||
|
||||
class Radar10642615DataFormatterTestCase(TestBase):
|
||||
class CompactVectorsFormattingTestCase(TestBase):
|
||||
|
||||
# test for rdar://problem/10642615 ()
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
||||
@skipUnlessDarwin
|
|
@ -8,9 +8,8 @@ import lldb
|
|||
from lldbtest import *
|
||||
import lldbutil
|
||||
|
||||
class Radar13338477DataFormatterTestCase(TestBase):
|
||||
class PtrToArrayDataFormatterTestCase(TestBase):
|
||||
|
||||
# test for rdar://problem/13338477 ()
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
||||
@skipUnlessDarwin
|
|
@ -8,9 +8,8 @@ import lldb
|
|||
from lldbtest import *
|
||||
import lldbutil
|
||||
|
||||
class Radar10449092DataFormatterTestCase(TestBase):
|
||||
class DataFormatterHexCapsTestCase(TestBase):
|
||||
|
||||
# test for rdar://problem/10449092 ()
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
||||
@skipUnlessDarwin
|
|
@ -9,7 +9,7 @@ from lldbtest import *
|
|||
import datetime
|
||||
import lldbutil
|
||||
|
||||
class DataFormatterRdar11086338TestCase(TestBase):
|
||||
class NSArraySyntheticTestCase(TestBase):
|
||||
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
|
@ -9,7 +9,7 @@ from lldbtest import *
|
|||
import datetime
|
||||
import lldbutil
|
||||
|
||||
class DataFormatterRdar11988289TestCase(TestBase):
|
||||
class NSDictionarySyntheticTestCase(TestBase):
|
||||
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
|
@ -9,7 +9,7 @@ from lldbtest import *
|
|||
import datetime
|
||||
import lldbutil
|
||||
|
||||
class DataFormatterRdar12529957TestCase(TestBase):
|
||||
class NSSetSyntheticTestCase(TestBase):
|
||||
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
"""
|
||||
Test lldb data formatter subsystem.
|
||||
"""
|
||||
|
||||
import os, time
|
||||
import unittest2
|
||||
import lldb
|
||||
from lldbtest import *
|
||||
import lldbutil
|
||||
|
||||
class Radar9973865DataFormatterTestCase(TestBase):
|
||||
|
||||
# test for rdar://problem/9973865 (If you use "${var}" in the summary string for an aggregate type, the summary doesn't print for a pointer to that type)
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
||||
@skipUnlessDarwin
|
||||
@dsym_test
|
||||
def test_with_dsym_and_run_command(self):
|
||||
"""Test data formatter commands."""
|
||||
self.buildDsym()
|
||||
self.data_formatter_commands()
|
||||
|
||||
@dwarf_test
|
||||
def test_with_dwarf_and_run_command(self):
|
||||
"""Test data formatter commands."""
|
||||
|
||||
self.buildDwarf()
|
||||
self.data_formatter_commands()
|
||||
|
||||
def setUp(self):
|
||||
# Call super's setUp().
|
||||
TestBase.setUp(self)
|
||||
# Find the line number to break at.
|
||||
self.line = line_number('main.cpp', '// Set break point at this line.')
|
||||
|
||||
def data_formatter_commands(self):
|
||||
"""Test that that file and class static variables display correctly."""
|
||||
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
|
||||
|
||||
lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
|
||||
|
||||
self.runCmd("run", RUN_SUCCEEDED)
|
||||
|
||||
# The stop reason of the thread should be breakpoint.
|
||||
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
|
||||
substrs = ['stopped',
|
||||
'stop reason = breakpoint'])
|
||||
|
||||
# This is the function to remove the custom formats in order to have a
|
||||
# clean slate for the next test case.
|
||||
def cleanup():
|
||||
self.runCmd('type summary clear', check=False)
|
||||
|
||||
# Execute the cleanup function during test case tear down.
|
||||
self.addTearDownHook(cleanup)
|
||||
|
||||
self.runCmd("type summary add --summary-string \"SUMMARY SUCCESS ${var}\" Summarize")
|
||||
|
||||
self.expect('frame variable mine_ptr',
|
||||
substrs = ['SUMMARY SUCCESS summarize_ptr_t @ '])
|
||||
|
||||
self.expect('frame variable *mine_ptr',
|
||||
substrs = ['SUMMARY SUCCESS summarize_t @'])
|
||||
|
||||
self.runCmd("type summary add --summary-string \"SUMMARY SUCCESS ${var.first}\" Summarize")
|
||||
|
||||
self.expect('frame variable mine_ptr',
|
||||
substrs = ['SUMMARY SUCCESS 10'])
|
||||
|
||||
self.expect('frame variable *mine_ptr',
|
||||
substrs = ['SUMMARY SUCCESS 10'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
import atexit
|
||||
lldb.SBDebugger.Initialize()
|
||||
atexit.register(lambda: lldb.SBDebugger.Terminate())
|
||||
unittest2.main()
|
|
@ -1,30 +0,0 @@
|
|||
//===-- main.cpp ------------------------------------------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <stdio.h>
|
||||
struct Summarize
|
||||
{
|
||||
int first;
|
||||
int second;
|
||||
};
|
||||
|
||||
typedef Summarize summarize_t;
|
||||
typedef summarize_t *summarize_ptr_t;
|
||||
|
||||
summarize_t global_mine = {30, 40};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
summarize_t mine = {10, 20};
|
||||
summarize_ptr_t mine_ptr = &mine;
|
||||
printf ("Summarize: first: %d second: %d and address: 0x%p\n", mine.first, mine.second, mine_ptr); // Set break point at this line.
|
||||
printf ("Global summarize: first: %d second: %d.\n", global_mine.first, global_mine.second);
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
LEVEL = ../../../make
|
||||
|
||||
CXX_SOURCES := main.cpp
|
||||
|
||||
include $(LEVEL)/Makefile.rules
|
|
@ -8,11 +8,10 @@ import lldb
|
|||
from lldbtest import *
|
||||
import lldbutil
|
||||
|
||||
class Rdar10887661TestCase(TestBase):
|
||||
class SyntheticCappingTestCase(TestBase):
|
||||
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
||||
# rdar://problem/10887661
|
||||
@skipUnlessDarwin
|
||||
@dsym_test
|
||||
def test_with_dsym_and_run_command(self):
|
||||
|
@ -20,7 +19,6 @@ class Rdar10887661TestCase(TestBase):
|
|||
self.buildDsym()
|
||||
self.capping_test_commands()
|
||||
|
||||
# rdar://problem/10887661
|
||||
@dwarf_test
|
||||
def test_with_dwarf_and_run_command(self):
|
||||
"""Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs."""
|
|
@ -9,7 +9,7 @@ from lldbtest import *
|
|||
import datetime
|
||||
import lldbutil
|
||||
|
||||
class DataFormatterRdar12437442TestCase(TestBase):
|
||||
class SyntheticFilterRecomputingTestCase(TestBase):
|
||||
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
|
@ -8,9 +8,8 @@ import lldb
|
|||
from lldbtest import *
|
||||
import lldbutil
|
||||
|
||||
class Radar9973992DataFormatterTestCase(TestBase):
|
||||
class VarInAggregateMisuseTestCase(TestBase):
|
||||
|
||||
# test for rdar://problem/9973992 (What should we do for "${var}" in summaries of aggregate types?)
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
||||
@skipUnlessDarwin
|
||||
|
@ -23,6 +22,7 @@ class Radar9973992DataFormatterTestCase(TestBase):
|
|||
@dwarf_test
|
||||
def test_with_dwarf_and_run_command(self):
|
||||
"""Test data formatter commands."""
|
||||
|
||||
self.buildDwarf()
|
||||
self.data_formatter_commands()
|
||||
|
Loading…
Reference in New Issue