summaryrefslogtreecommitdiffstats
path: root/test/Makefile
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-10 23:00:15 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-10 23:00:15 +0000
commit58033318b10c68056382f7c523c7dcaa3ba14941 (patch)
treeecb289ec8e7717e789910d19ddaae665cb1c58d4 /test/Makefile
parentcbd1933f83e2332b2d7add10459f80cc4e7eb7bf (diff)
Teach LIT2 how to run Clang tests in the objdir for srcdir != objdir builds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/Makefile b/test/Makefile
index 12d713b516..1a109758ba 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -8,6 +8,9 @@ else
TESTDIRS ?= $(PROJ_SRC_DIR)
endif
+# LIT2 wants objdir paths, so it will pick up the lit.site.cfg.
+LIT2_TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
+
ifndef TESTARGS
ifdef VERBOSE
TESTARGS = -v
@@ -23,12 +26,12 @@ else
endif
ifdef LIT2
-all::
+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) $(TESTDIRS) $(VGARG)
+ $(TESTARGS) $(LIT2_TESTDIRS) $(VGARG)
else
all::
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
@@ -39,6 +42,19 @@ all::
$(TESTARGS) $(TESTDIRS) $(VGARG)
endif
+FORCE:
+
+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\"\"\")" >> $@
+
clean::
@ rm -rf Output/