forked from OSchip/llvm-project
62 lines
1.4 KiB
Makefile
62 lines
1.4 KiB
Makefile
LEVEL = ../../..
|
|
include $(LEVEL)/Makefile.common
|
|
|
|
# Test in all immediate subdirectories if unset.
|
|
ifdef TESTSUITE
|
|
TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
|
|
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
|
|
else
|
|
TESTARGS = -s
|
|
endif
|
|
endif
|
|
|
|
ifdef VG
|
|
VGARG="--vg"
|
|
else
|
|
VGARG=
|
|
endif
|
|
|
|
ifdef LIT2
|
|
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::
|
|
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
|
|
@ $(PROJ_SRC_DIR)/../utils/test/MultiTestRunner.py \
|
|
--root $(PROJ_SRC_DIR) \
|
|
--path $(ToolDir) \
|
|
--path $(LLVM_SRC_ROOT)/test/Scripts \
|
|
$(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/
|
|
|
|
.PHONY: all report clean
|