[Lldb-commits] [PATCH] fixes for linux tests

dawn at burble.org dawn at burble.org
Wed Dec 21 17:05:13 PST 2011


Here's a few fixes for running some of the Linux tests.
Please review.  Ok to commit?
Thanks!
-Dawn
-------------- next part --------------
Index: test/macosx/order/TestOrderFile.py
===================================================================
--- test/macosx/order/TestOrderFile.py	(revision 147116)
+++ test/macosx/order/TestOrderFile.py	(working copy)
@@ -18,6 +18,7 @@
         self.buildDsym()
         self.order_file()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     def test_with_dwarf(self):
         """Test debug symbols follow the correct order by the order file."""
         self.buildDwarf()
Index: test/api/check_public_api_headers/TestPublicAPIHeaders.py
===================================================================
--- test/api/check_public_api_headers/TestPublicAPIHeaders.py	(revision 147116)
+++ test/api/check_public_api_headers/TestPublicAPIHeaders.py	(working copy)
@@ -26,7 +26,10 @@
         # Call the program generator to produce main.cpp.
         self.generate_main_cpp()
 
-        d = {'FRAMEWORK_INCLUDES' : "-F%s" % self.build_dir}
+        if sys.platform.startswith("darwin"):
+            d = {'FRAMEWORK_INCLUDES' : "-F%s" % self.build_dir}
+        if sys.platform.startswith("linux"):
+            d = {'FRAMEWORK_INCLUDES' : "-I%s" % os.path.join(os.environ["LLDB_SRC"], "include")}
         self.buildDefault(dictionary=d)
         self.exe_name = 'a.out'
         self.sanity_check_executable(self.exe_name)
@@ -45,6 +48,8 @@
         # For different platforms, the include statement can vary.
         if sys.platform.startswith("darwin"):
             include_stmt = "'#include <%s>' % os.path.join('LLDB', header)"
+        if sys.platform.startswith("linux"):
+            include_stmt = "'#include <%s>' % os.path.join(public_api_dir, header)"
         list = [eval(include_stmt) for header in public_headers if (header.startswith("SB") and
                                                                     header.endswith(".h"))]
         includes = '\n'.join(list)
@@ -66,6 +71,9 @@
         if sys.platform.startswith("darwin"):
             env_var = 'DYLD_FRAMEWORK_PATH'
             env_val = self.build_dir
+        if sys.platform.startswith("linux"):
+            env_var = 'LD_LIBRARY_PATH'
+            env_val = self.build_dir
 
         env_cmd = "settings set target.env-vars %s=%s" %(env_var, env_val)
         if self.TraceOn():
Index: test/api/check_public_api_headers/Makefile
===================================================================
--- test/api/check_public_api_headers/Makefile	(revision 147116)
+++ test/api/check_public_api_headers/Makefile	(working copy)
@@ -1,7 +1,11 @@
 LEVEL = ../../make
 
 CXX_SOURCES := main.cpp
-LD_EXTRAS ?= -framework LLDB
+ifeq "$(OS)" "Darwin"
+    LD_EXTRAS ?= -framework LLDB
+else
+    LD_EXTRAS ?= $(LLDB_BUILD_DIR)/_lldb.so
+endif
 
 # Example dictionary to pass to the Python build method:
 # 


More information about the lldb-commits mailing list