Add gTest unittests to clang, and write the first one.
This is the Makefile version only; the cmake implementation is coming soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124777 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Makefile b/test/Makefile
index 5bb50c6..b0c829c 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -29,7 +29,7 @@
LIT_ARGS += "--vg"
endif
-all:: lit.site.cfg
+all:: lit.site.cfg Unit/lit.site.cfg
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
@ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
$(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
@@ -47,6 +47,22 @@
-e "s#@TARGET_TRIPLE@#$(TARGET_TRIPLE)#g" \
$(PROJ_SRC_DIR)/lit.site.cfg.in > $@
+Unit/lit.site.cfg: FORCE
+ @echo "Making Clang 'Unit/lit.site.cfg' file..."
+ @$(MKDIR) $(dir $@)
+ @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#@LLVM_LIBS_DIR@#$(LibDir)#g" \
+ -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
+ -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
+ -e "s#@TARGET_TRIPLE@#$(TARGET_TRIPLE)#g" \
+ -e "s#@LLVM_BUILD_MODE@#$(BuildMode)#g" \
+ -e "s#@ENABLE_SHARED@#$(ENABLE_SHARED)#g" \
+ -e "s#@SHLIBDIR@#$(SharedLibDir)#g" \
+ -e "s#@SHLIBPATH_VAR@#$(SHLIBPATH_VAR)#g" \
+ $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
+
clean::
@ find . -name Output | xargs rm -fr