Tweak clang testing.
 - Move CMake to using the new test runner.

 - Switch Makefiles to use the lit.site.cfg.in template.

 - Remove explicit --path arguments, instead this gets written into the site
   configuration. This means running lit from the command line should use the
   exact same configuration as is used in 'make test', assuming it can find the
   site configuration file. You still need to run 'make test' (or the cmake
   build target equivalent) at least once.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82160 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Makefile b/test/Makefile
index 1a10975..223fd83 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -29,8 +29,6 @@
 all:: lit.site.cfg
 	@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
 	@ $(LLVM_SRC_ROOT)/utils/lit/lit.py \
-	  --path $(ToolDir) \
-	  --path $(LLVM_SRC_ROOT)/test/Scripts \
 	  $(TESTARGS) $(LIT2_TESTDIRS) $(VGARG)
 else
 all::
@@ -46,14 +44,10 @@
 
 lit.site.cfg: FORCE
 	@echo "Making 'lit.site.cfg' file..."
-	@echo "## Autogenerated by Makefile ##" > $@
-	@echo "# Do not edit!" >> $@
-	@echo >> $@
-	@echo "# Preserve some key paths for use by main LLVM test suite config." >> $@
-	@echo "config.clang_obj_root = \"\"\"$(PROJ_OBJ_DIR)/..\"\"\"" >> $@
-	@echo >> $@
-	@echo "# Let the main config do the real work." >> $@
-	@echo "lit.load_config(config, \"\"\"$(PROJ_SRC_DIR)/lit.cfg\"\"\")" >> $@
+	@sed -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
+	     -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
+	     -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
+	     $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
 
 clean::
 	@ rm -rf Output/