summaryrefslogtreecommitdiff
path: root/test/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile32
1 files changed, 29 insertions, 3 deletions
diff --git a/test/Makefile b/test/Makefile
index 271f46fdd6dc9..8543d431442ba 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -2,7 +2,14 @@ LEVEL = ../../..
include $(LEVEL)/Makefile.common
# Test in all immediate subdirectories if unset.
-TESTDIRS ?= $(shell echo $(PROJ_SRC_DIR)/*/)
+ifdef TESTSUITE
+TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
+else
+TESTDIRS ?= $(PROJ_SRC_DIR)
+endif
+
+# 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
+TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
ifndef TESTARGS
ifdef VERBOSE
@@ -12,9 +19,28 @@ TESTARGS = -s
endif
endif
-all::
+ifdef VG
+ VGARG="--vg"
+else
+ VGARG=
+endif
+
+all:: lit.site.cfg
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
- @ PATH=$(ToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$$PATH VG=$(VG) ../utils/test/MultiTestRunner.py $(TESTARGS) $(TESTDIRS)
+ @ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
+ $(TESTARGS) $(TESTDIRS) $(VGARG)
+
+FORCE:
+
+lit.site.cfg: FORCE
+ @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#@LLVM_LIBS_DIR@#$(LibDir)#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::
@ rm -rf Output/