2010-06-08 20:34:18 +00:00
|
|
|
CLANG_LEVEL := ..
|
|
|
|
include $(CLANG_LEVEL)/Makefile
|
2006-06-18 05:42:02 +00:00
|
|
|
|
2009-07-12 19:00:20 +00:00
|
|
|
# Test in all immediate subdirectories if unset.
|
2009-09-04 17:40:27 +00:00
|
|
|
ifdef TESTSUITE
|
|
|
|
TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
|
|
|
|
else
|
2009-07-25 15:26:08 +00:00
|
|
|
TESTDIRS ?= $(PROJ_SRC_DIR)
|
2009-09-04 17:40:27 +00:00
|
|
|
endif
|
2008-03-10 19:32:31 +00:00
|
|
|
|
2009-09-22 05:16:02 +00:00
|
|
|
# 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
|
|
|
|
TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
|
2009-09-10 23:00:15 +00:00
|
|
|
|
2009-11-05 06:55:24 +00:00
|
|
|
# Allow EXTRA_TESTDIRS to provide additional test directories.
|
|
|
|
TESTDIRS += $(EXTRA_TESTDIRS)
|
|
|
|
|
2009-06-13 18:28:48 +00:00
|
|
|
ifndef TESTARGS
|
2008-04-06 22:32:01 +00:00
|
|
|
ifdef VERBOSE
|
2010-05-12 02:47:23 +00:00
|
|
|
TESTARGS = -v
|
2009-03-13 00:21:49 +00:00
|
|
|
else
|
2011-06-16 01:32:21 +00:00
|
|
|
TESTARGS = -s -v
|
2009-03-18 20:25:18 +00:00
|
|
|
endif
|
2008-04-06 22:32:01 +00:00
|
|
|
endif
|
|
|
|
|
2009-11-05 16:36:19 +00:00
|
|
|
# Make sure any extra test suites can find the main site config.
|
|
|
|
LIT_ARGS := --param clang_site_config=$(PROJ_OBJ_DIR)/lit.site.cfg
|
|
|
|
|
2009-07-11 18:34:43 +00:00
|
|
|
ifdef VG
|
2009-11-05 16:36:19 +00:00
|
|
|
LIT_ARGS += "--vg"
|
2009-07-11 18:34:43 +00:00
|
|
|
endif
|
|
|
|
|
2011-02-03 04:51:52 +00:00
|
|
|
all:: lit.site.cfg Unit/lit.site.cfg
|
2009-09-08 16:39:23 +00:00
|
|
|
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
|
2009-09-29 14:54:28 +00:00
|
|
|
@ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
|
2009-11-05 16:36:19 +00:00
|
|
|
$(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
|
2008-03-18 07:03:00 +00:00
|
|
|
|
2009-09-10 23:00:15 +00:00
|
|
|
FORCE:
|
|
|
|
|
|
|
|
lit.site.cfg: FORCE
|
2009-09-20 19:04:35 +00:00
|
|
|
@echo "Making Clang 'lit.site.cfg' file..."
|
2014-01-27 22:57:33 +00:00
|
|
|
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
|
2011-03-08 22:17:40 +00:00
|
|
|
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_LIBS_DIR@=$(LibDir)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@CLANG_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@CLANG_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> lit.tmp
|
2013-12-18 15:08:56 +00:00
|
|
|
@$(ECHOPATH) s=@CLANG_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
|
2011-03-08 22:17:40 +00:00
|
|
|
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
|
2014-10-17 23:50:47 +00:00
|
|
|
@$(ECHOPATH) s=@LLVM_HOST_TRIPLE@=$(HOST_TRIPLE)=g >> lit.tmp
|
2013-08-27 19:27:35 +00:00
|
|
|
@$(ECHOPATH) s=@ENABLE_CLANG_ARCMT@=$(ENABLE_CLANG_ARCMT)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@ENABLE_CLANG_STATIC_ANALYZER@=$(ENABLE_CLANG_STATIC_ANALYZER)=g >> lit.tmp
|
2014-01-08 13:00:32 +00:00
|
|
|
@$(ECHOPATH) s=@ENABLE_CLANG_EXAMPLES@=$(ENABLE_CLANG_EXAMPLES)=g >> lit.tmp
|
2014-01-08 20:06:24 +00:00
|
|
|
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
|
2011-03-08 22:17:40 +00:00
|
|
|
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
|
|
|
|
@-rm -f lit.tmp
|
2009-09-10 23:00:15 +00:00
|
|
|
|
2011-02-03 04:51:52 +00:00
|
|
|
Unit/lit.site.cfg: FORCE
|
|
|
|
@echo "Making Clang 'Unit/lit.site.cfg' file..."
|
|
|
|
@$(MKDIR) $(dir $@)
|
2014-01-27 22:57:33 +00:00
|
|
|
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > unit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> unit.tmp
|
2014-01-27 22:57:30 +00:00
|
|
|
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> unit.tmp
|
2011-03-08 22:17:40 +00:00
|
|
|
@$(ECHOPATH) s=@LLVM_LIBS_DIR@=$(LibDir)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@CLANG_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@CLANG_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BUILD_MODE@=$(BuildMode)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@SHLIBPATH_VAR@=$(SHLIBPATH_VAR)=g >> unit.tmp
|
|
|
|
@sed -f unit.tmp $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
|
|
|
|
@-rm -f unit.tmp
|
2011-02-03 04:51:52 +00:00
|
|
|
|
2008-03-18 07:03:00 +00:00
|
|
|
clean::
|
2009-11-03 22:39:56 +00:00
|
|
|
@ find . -name Output | xargs rm -fr
|
2008-03-18 07:03:00 +00:00
|
|
|
|
2008-04-06 22:32:01 +00:00
|
|
|
.PHONY: all report clean
|