StmtPrinter: factor out arg printing code to PrintCallArgs
[clang.git] / test / Makefile
blobb0c829c255e6d2c1738a20e8e0bbad229969d6b8
1 CLANG_LEVEL := ..
2 include $(CLANG_LEVEL)/Makefile
4 # Test in all immediate subdirectories if unset.
5 ifdef TESTSUITE
6 TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
7 else
8 TESTDIRS ?= $(PROJ_SRC_DIR)
9 endif
11 # 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
12 TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
14 # Allow EXTRA_TESTDIRS to provide additional test directories.
15 TESTDIRS += $(EXTRA_TESTDIRS)
17 ifndef TESTARGS
18 ifdef VERBOSE
19 TESTARGS = -v
20 else
21 TESTARGS = -s -v
22 endif
23 endif
25 # Make sure any extra test suites can find the main site config.
26 LIT_ARGS := --param clang_site_config=$(PROJ_OBJ_DIR)/lit.site.cfg
28 ifdef VG
29 LIT_ARGS += "--vg"
30 endif
32 all:: lit.site.cfg Unit/lit.site.cfg
33 @ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
34 @ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
35 $(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
37 FORCE:
39 lit.site.cfg: FORCE
40 @echo "Making Clang 'lit.site.cfg' file..."
41 @sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
42 -e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
43 -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
44 -e "s#@LLVM_LIBS_DIR@#$(LibDir)#g" \
45 -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
46 -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
47 -e "s#@TARGET_TRIPLE@#$(TARGET_TRIPLE)#g" \
48 $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
50 Unit/lit.site.cfg: FORCE
51 @echo "Making Clang 'Unit/lit.site.cfg' file..."
52 @$(MKDIR) $(dir $@)
53 @sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
54 -e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
55 -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
56 -e "s#@LLVM_LIBS_DIR@#$(LibDir)#g" \
57 -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
58 -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
59 -e "s#@TARGET_TRIPLE@#$(TARGET_TRIPLE)#g" \
60 -e "s#@LLVM_BUILD_MODE@#$(BuildMode)#g" \
61 -e "s#@ENABLE_SHARED@#$(ENABLE_SHARED)#g" \
62 -e "s#@SHLIBDIR@#$(SharedLibDir)#g" \
63 -e "s#@SHLIBPATH_VAR@#$(SHLIBPATH_VAR)#g" \
64 $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
66 clean::
67 @ find . -name Output | xargs rm -fr
69 .PHONY: all report clean