Refactored TestInitializerList to not be an inline test.
Refactored Makefiles to use USE_LIBCPP instead of adding FLAGS directly
Fixed copy/paste error in TestDataFormatterUnordered class name
Differenttial Revision: http://reviews.llvm.org/D9426
llvm-svn: 236401
-import lldbinline
+"""
+Test lldb data formatter subsystem.
+"""
+
+import os, time
+import unittest2
+import lldb
from lldbtest import *
+import lldbutil
+
+class InitializerListTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipUnlessDarwin
+ @dsym_test
+ def test_with_dsym(self):
+ """Test data formatter commands."""
+ self.buildDsym()
+ self.data_formatter_commands()
+
+ @skipIfWindows # libc++ not ported to Windows yet
+ @skipIfGcc
+ @expectedFailureLinux # fails on clang 3.5 and tot
+ @dwarf_test
+ def test_with_dwarf(self):
+ """Test data formatter commands."""
+ self.buildDwarf()
+ self.data_formatter_commands()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def data_formatter_commands(self):
+ """Test that that file and class static variables display correctly."""
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+
+ bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
+
+ 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'])
+
+ self.expect("frame variable ili", substrs = ['[1] = 2','[4] = 5'])
+ self.expect("frame variable ils", substrs = ['[4] = "surprise it is a long string!! yay!!"'])
+
+ self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-# added decorator to mark as XFAIL for Linux
-# non-core functionality, need to reenable and fix later (DES 2014.11.07)
-lldbinline.MakeInlineTest(__file__, globals(),expectedFailureLinux)
+if __name__ == '__main__':
+ import atexit
+ lldb.SBDebugger.Initialize()
+ atexit.register(lambda: lldb.SBDebugger.Terminate())
+ unittest2.main()
std::initializer_list<int> ili{1,2,3,4,5};
std::initializer_list<std::string> ils{"1","2","3","4","surprise it is a long string!! yay!!"};
- return 0; //% self.expect("frame variable ili", substrs = ['[1] = 2','[4] = 5'])
- //% self.expect("frame variable ils", substrs = ['[4] = "surprise it is a long string!! yay!!"'])
+ return 0; // Set break point at this line.
}
+
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
+CXXFLAGS += -O0
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
+ @skipIfGcc
@skipIfWindows # libc++ not ported to Windows yet
@dwarf_test
def test_with_dwarf_and_run_command(self):
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
+CXXFLAGS += -O0
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
+ @skipIfGcc
@skipIfWindows # libc++ not ported to Windows yet
@dwarf_test
def test_with_dwarf_and_run_command(self):
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
+CXXFLAGS += -O0
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
+ @skipIfGcc
@skipIfWindows # libc++ not ported to Windows yet
@dwarf_test
def test_with_dwarf_and_run_command(self):
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
+CXXFLAGS += -O0
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
@skipIfWindows # libc++ not ported to Windows yet
+ @skipIfGcc
@dwarf_test
def test_with_dwarf_and_run_command(self):
"""Test data formatter commands."""
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
+CXXFLAGS += -O0
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
+ @skipIfGcc
@skipIfWindows # libc++ not ported to Windows yet
@dwarf_test
def test_with_dwarf_and_run_command(self):
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
+CXXFLAGS += -O0
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
+ @skipIfGcc
@skipIfWindows # libc++ not ported to Windows yet
@dwarf_test
def test_with_dwarf_and_run_command(self):
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
+CXXFLAGS += -O0
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
+ @skipIfGcc
@skipIfWindows # libc++ not ported to Windows yet
@dwarf_test
def test_with_dwarf_and_run_command(self):
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0 -std=c++11
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
+CXXFLAGS += -O0
from lldbtest import *
import lldbutil
-class LibcxxMultiMapDataFormatterTestCase(TestBase):
+class LibcxxUnorderedDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
@dwarf_test
+ @skipIfGcc
def test_with_dwarf_and_run_command(self):
"""Test data formatter commands."""
self.buildDwarf()
LEVEL = ../../../../../make
CXX_SOURCES := main.cpp
-
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
+CXXFLAGS += -O0
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
+ @skipIfGcc
@skipIfWindows # http://llvm.org/pr21800
@dwarf_test
def test_with_dwarf_and_run_command(self):
CXX_SOURCES := main.cpp
+USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
+CXXFLAGS += -O0
self.buildDsym()
self.data_formatter_commands()
- @skipIfLinux # No standard locations for libc++ on Linux, so skip for now
+ @skipIfGcc
@skipIfWindows # libc++ not ported to Windows yet
@dwarf_test
def test_with_dwarf_and_run_command(self):
return self.lib_dir
def getLibcPlusPlusLibs(self):
- if sys.platform.startswith('freebsd'):
+ if sys.platform.startswith('freebsd') or sys.platform.startswith('linux'):
return ['libc++.so.1']
else:
return ['libc++.1.dylib','libc++abi.dylib']
ifneq (,$(findstring clang,$(CC)))
CXXFLAGS += -stdlib=libc++
LDFLAGS += -stdlib=libc++
+ ifeq "$(OS)" "Linux"
+ # This is the default install location on Ubuntu 14.04
+ CXXFLAGS += -I/usr/include/c++/v1
+ endif
endif
endif