diff options
| author | Matt Kopec <Matt.Kopec@intel.com> | 2013-09-25 17:44:00 +0000 |
|---|---|---|
| committer | Matt Kopec <Matt.Kopec@intel.com> | 2013-09-25 17:44:00 +0000 |
| commit | 7663b3a9d05d1e25c9bedd1cc7b79b8726e60ecb (patch) | |
| tree | 6d84cdff4da630ba6d6d3cd89be9ae7cb91f2973 /lldb/test/functionalities/plugins | |
| parent | 95e036c6693818c01081cb94d4e4f570563a04d4 (diff) | |
| download | bcm5719-llvm-7663b3a9d05d1e25c9bedd1cc7b79b8726e60ecb.tar.gz bcm5719-llvm-7663b3a9d05d1e25c9bedd1cc7b79b8726e60ecb.zip | |
Add support for TestPluginComands on Linux. Also, rework makefile dsym target.
llvm-svn: 191383
Diffstat (limited to 'lldb/test/functionalities/plugins')
3 files changed, 26 insertions, 16 deletions
diff --git a/lldb/test/functionalities/plugins/commands/Makefile b/lldb/test/functionalities/plugins/commands/Makefile index 2d79cf61c16..8af06446ece 100644 --- a/lldb/test/functionalities/plugins/commands/Makefile +++ b/lldb/test/functionalities/plugins/commands/Makefile @@ -1,11 +1,8 @@ -all: foo.dylib +LEVEL = ../../../make -CWD := $(shell pwd) +DYLIB_CXX_SOURCES := plugin.cpp +DYLIB_NAME := plugin +DYLIB_ONLY := YES +MAKE_DSYM := NO -all: foo.dylib - -foo.dylib: - clang++ -O0 -g -stdlib=libc++ -dynamiclib -o plugin.dylib plugin.cpp -framework LLDB -F $(LLDB_FRAMEWORK)/.. - -clean: - rm -rf plugin.dylib plugin.dylib.dSYM/* plugin.dylib.dSYM +include $(LEVEL)/Makefile.rules diff --git a/lldb/test/functionalities/plugins/commands/TestPluginCommands.py b/lldb/test/functionalities/plugins/commands/TestPluginCommands.py index a53edca679d..660c6a9ea4b 100644 --- a/lldb/test/functionalities/plugins/commands/TestPluginCommands.py +++ b/lldb/test/functionalities/plugins/commands/TestPluginCommands.py @@ -16,19 +16,26 @@ class PluginCommandTestCase(TestBase): def setUp(self): # Call super's setUp(). TestBase.setUp(self) + self.lib_dir = os.environ["LLDB_LIB_DIR"] - @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") + @skipIfi386 # This test links against liblldb.so. Thus, the test requires a 32-bit liblldb.so. def test_load_plugin(self): """Test that plugins that load commands work correctly.""" - # Invoke the default build rule. - self.buildDefault() - + plugin_name = "plugin" + if sys.platform.startswith("darwin"): + plugin_lib_name = "lib%s.dylib" % plugin_name + else: + plugin_lib_name = "lib%s.so" % plugin_name + + # Invoke the library build rule. + self.buildLibrary("plugin.cpp", plugin_name) + debugger = lldb.SBDebugger.Create() retobj = lldb.SBCommandReturnObject() - - retval = debugger.GetCommandInterpreter().HandleCommand("plugin load plugin.dylib",retobj) + + retval = debugger.GetCommandInterpreter().HandleCommand("plugin load %s" % plugin_lib_name, retobj) retobj.Clear() diff --git a/lldb/test/functionalities/plugins/commands/plugin.cpp b/lldb/test/functionalities/plugins/commands/plugin.cpp index 7b4e46fc484..be3d29325de 100644 --- a/lldb/test/functionalities/plugins/commands/plugin.cpp +++ b/lldb/test/functionalities/plugins/commands/plugin.cpp @@ -1,4 +1,4 @@ -//===-- fooplugin.cpp -------------------------------------------*- C++ -*-===// +//===-- plugin.cpp -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -13,9 +13,15 @@ Compile this into a dylib foo.dylib and load by placing in appropriate locations by typing plugin load foo.dylib at the LLDB command line */ +#if defined (__APPLE__) #include <LLDB/SBCommandInterpreter.h> #include <LLDB/SBCommandReturnObject.h> #include <LLDB/SBDebugger.h> +#else +#include <lldb/API/SBCommandInterpreter.h> +#include <lldb/API/SBCommandReturnObject.h> +#include <lldb/API/SBDebugger.h> +#endif namespace lldb { bool |

