2010-06-09 04:34:18 +08:00
|
|
|
CLANG_LEVEL := ..
|
|
|
|
include $(CLANG_LEVEL)/Makefile
|
2006-06-18 13:42:02 +08:00
|
|
|
|
2009-07-13 03:00:20 +08:00
|
|
|
# Test in all immediate subdirectories if unset.
|
2009-09-05 01:40:27 +08:00
|
|
|
ifdef TESTSUITE
|
|
|
|
TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
|
|
|
|
else
|
2009-07-25 23:26:08 +08:00
|
|
|
TESTDIRS ?= $(PROJ_SRC_DIR)
|
2009-09-05 01:40:27 +08:00
|
|
|
endif
|
2008-03-11 03:32:31 +08:00
|
|
|
|
2009-09-22 13:16:02 +08:00
|
|
|
# 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
|
|
|
|
TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
|
2009-09-11 07:00:15 +08:00
|
|
|
|
2009-11-05 14:55:24 +08:00
|
|
|
# Allow EXTRA_TESTDIRS to provide additional test directories.
|
|
|
|
TESTDIRS += $(EXTRA_TESTDIRS)
|
|
|
|
|
2009-06-14 02:28:48 +08:00
|
|
|
ifndef TESTARGS
|
2008-04-07 06:32:01 +08:00
|
|
|
ifdef VERBOSE
|
2010-05-12 10:47:23 +08:00
|
|
|
TESTARGS = -v
|
2009-03-13 08:21:49 +08:00
|
|
|
else
|
2010-06-25 13:00:29 +08:00
|
|
|
TESTARGS = -s -v
|
2009-03-19 04:25:18 +08:00
|
|
|
endif
|
2008-04-07 06:32:01 +08:00
|
|
|
endif
|
|
|
|
|
2009-11-06 00:36:19 +08: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-12 02:34:43 +08:00
|
|
|
ifdef VG
|
2009-11-06 00:36:19 +08:00
|
|
|
LIT_ARGS += "--vg"
|
2009-07-12 02:34:43 +08:00
|
|
|
endif
|
|
|
|
|
2009-09-11 07:00:15 +08:00
|
|
|
all:: lit.site.cfg
|
2009-09-09 00:39:23 +08:00
|
|
|
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
|
2009-09-29 22:54:28 +08:00
|
|
|
@ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
|
2009-11-06 00:36:19 +08:00
|
|
|
$(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
|
2008-03-18 15:03:00 +08:00
|
|
|
|
2009-09-11 07:00:15 +08:00
|
|
|
FORCE:
|
|
|
|
|
|
|
|
lit.site.cfg: FORCE
|
2009-09-21 03:04:35 +08:00
|
|
|
@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" \
|
2009-09-18 03:55:53 +08:00
|
|
|
-e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
|
2009-09-26 15:36:09 +08:00
|
|
|
-e "s#@LLVM_LIBS_DIR@#$(LibDir)#g" \
|
2009-09-21 03:04:35 +08:00
|
|
|
-e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
|
|
|
|
-e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
|
2009-11-03 15:25:53 +08:00
|
|
|
-e "s#@TARGET_TRIPLE@#$(TARGET_TRIPLE)#g" \
|
2009-09-18 03:55:53 +08:00
|
|
|
$(PROJ_SRC_DIR)/lit.site.cfg.in > $@
|
2009-09-11 07:00:15 +08:00
|
|
|
|
2008-03-18 15:03:00 +08:00
|
|
|
clean::
|
2009-11-04 06:39:56 +08:00
|
|
|
@ find . -name Output | xargs rm -fr
|
2008-03-18 15:03:00 +08:00
|
|
|
|
2008-04-07 06:32:01 +08:00
|
|
|
.PHONY: all report clean
|