[cfe-commits] r82401 - in /cfe/trunk/test: CMakeLists.txt Makefile lit.cfg lit.site.cfg.in

Daniel Dunbar daniel at zuster.org
Sun Sep 20 12:04:35 PDT 2009


Author: ddunbar
Date: Sun Sep 20 14:04:35 2009
New Revision: 82401

URL: http://llvm.org/viewvc/llvm-project?rev=82401&view=rev
Log:
Include LLVM {src,obj} root in lit.site.cfg, to support non-standard layouts.

Modified:
    cfe/trunk/test/CMakeLists.txt
    cfe/trunk/test/Makefile
    cfe/trunk/test/lit.cfg
    cfe/trunk/test/lit.site.cfg.in

Modified: cfe/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CMakeLists.txt?rev=82401&r1=82400&r2=82401&view=diff

==============================================================================
--- cfe/trunk/test/CMakeLists.txt (original)
+++ cfe/trunk/test/CMakeLists.txt Sun Sep 20 14:04:35 2009
@@ -32,9 +32,11 @@
 
   foreach(testdir ${CLANG_TEST_DIRECTORIES})
     add_custom_target(clang-test-${testdir} 
-      COMMAND sed -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
-                  -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
+      COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
+                  -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
                   -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
+                  -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
+                  -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
                   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
                   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
       COMMAND ${PYTHON_EXECUTABLE} 
@@ -46,9 +48,11 @@
   endforeach()
 
   add_custom_target(clang-test
-    COMMAND sed -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
-                -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
+    COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
+                -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
                 -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
+                -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
+                -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
                 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
                 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
     COMMAND ${PYTHON_EXECUTABLE} 

Modified: cfe/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Makefile?rev=82401&r1=82400&r2=82401&view=diff

==============================================================================
--- cfe/trunk/test/Makefile (original)
+++ cfe/trunk/test/Makefile Sun Sep 20 14:04:35 2009
@@ -43,10 +43,12 @@
 FORCE:
 
 lit.site.cfg: FORCE
-	@echo "Making 'lit.site.cfg' file..."
-	@sed -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
-	     -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
+	@echo "Making Clang 'lit.site.cfg' file..."
+	@sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
+	     -e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
 	     -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
+	     -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
+	     -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
 	     $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
 
 clean::

Modified: cfe/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=82401&r1=82400&r2=82401&view=diff

==============================================================================
--- cfe/trunk/test/lit.cfg (original)
+++ cfe/trunk/test/lit.cfg Sun Sep 20 14:04:35 2009
@@ -27,11 +27,8 @@
         config.test_exec_root = os.path.join(clang_obj_root, 'test')
 
     # Set llvm_{src,obj}_root for use by others.
-    config.llvm_src_root = os.path.join(config.test_source_root,
-                                        '..', '..', '..')
-    if clang_obj_root is not None:
-        config.llvm_obj_root = os.path.join(clang_obj_root,
-                                            '..', '..')
+    config.llvm_src_root = getattr(config, 'llvm_src_root', None)
+    config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
 
     # Tweak the PATH to include the tools dir and the scripts dir.
     if clang_obj_root is not None:

Modified: cfe/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.site.cfg.in?rev=82401&r1=82400&r2=82401&view=diff

==============================================================================
--- cfe/trunk/test/lit.site.cfg.in (original)
+++ cfe/trunk/test/lit.site.cfg.in Sun Sep 20 14:04:35 2009
@@ -1,7 +1,9 @@
 ## Autogenerated by LLVM/Clang configuration.
 # Do not edit!
-config.clang_obj_root = "@CLANG_BINARY_DIR@"
+config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
+config.clang_obj_root = "@CLANG_BINARY_DIR@"
 
 # Let the main config do the real work.
 lit.load_config(config, "@CLANG_SOURCE_DIR@/test/lit.cfg")





More information about the cfe-commits mailing list