blob: 9ed683435f44e248501fc9a5ce910d9ee333f3a2 [file] [log] [blame]
Chris Lattner1467e032007-07-16 04:35:52 +00001LEVEL = ../../..
2include $(LEVEL)/Makefile.common
Reid Spencer5f016e22007-07-11 17:01:13 +00003
Daniel Dunbar0126e5e2009-07-12 19:00:20 +00004# Test in all immediate subdirectories if unset.
Daniel Dunbar2f42d4a2009-09-04 17:40:27 +00005ifdef TESTSUITE
6TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
7else
Daniel Dunbar10aebbb2009-07-25 15:26:08 +00008TESTDIRS ?= $(PROJ_SRC_DIR)
Daniel Dunbar2f42d4a2009-09-04 17:40:27 +00009endif
Chris Lattner15bd7992008-03-10 19:32:31 +000010
Daniel Dunbar58033312009-09-10 23:00:15 +000011# LIT2 wants objdir paths, so it will pick up the lit.site.cfg.
12LIT2_TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
13
Daniel Dunbard5134b02009-06-13 18:28:48 +000014ifndef TESTARGS
Chris Lattner9d294b92008-04-06 22:32:01 +000015ifdef VERBOSE
Daniel Dunbard5134b02009-06-13 18:28:48 +000016TESTARGS = -v
Mike Stump039df912009-03-13 00:21:49 +000017else
Daniel Dunbard5134b02009-06-13 18:28:48 +000018TESTARGS = -s
Mike Stump9a2f1ac2009-03-18 20:25:18 +000019endif
Chris Lattner9d294b92008-04-06 22:32:01 +000020endif
21
Nuno Lopesa7afc452009-07-11 18:34:43 +000022ifdef VG
23 VGARG="--vg"
24else
25 VGARG=
26endif
27
Daniel Dunbard9c2e782009-09-20 22:00:17 +000028ifndef LIT1
Daniel Dunbar58033312009-09-10 23:00:15 +000029all:: lit.site.cfg
Daniel Dunbar724827f2009-09-08 16:39:23 +000030 @ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
31 @ $(LLVM_SRC_ROOT)/utils/lit/lit.py \
Daniel Dunbar58033312009-09-10 23:00:15 +000032 $(TESTARGS) $(LIT2_TESTDIRS) $(VGARG)
Daniel Dunbar724827f2009-09-08 16:39:23 +000033else
Chris Lattner1467e032007-07-16 04:35:52 +000034all::
Mike Stumpe3c75e02009-03-13 00:41:24 +000035 @ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
Daniel Dunbar67796472009-07-27 19:01:13 +000036 @ $(PROJ_SRC_DIR)/../utils/test/MultiTestRunner.py \
Daniel Dunbar1db467f2009-07-31 05:54:17 +000037 --root $(PROJ_SRC_DIR) \
Daniel Dunbar67796472009-07-27 19:01:13 +000038 --path $(ToolDir) \
39 --path $(LLVM_SRC_ROOT)/test/Scripts \
40 $(TESTARGS) $(TESTDIRS) $(VGARG)
Daniel Dunbar724827f2009-09-08 16:39:23 +000041endif
Gabor Greif17feadf2008-03-18 07:03:00 +000042
Daniel Dunbar58033312009-09-10 23:00:15 +000043FORCE:
44
45lit.site.cfg: FORCE
Daniel Dunbar1b720a92009-09-20 19:04:35 +000046 @echo "Making Clang 'lit.site.cfg' file..."
47 @sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
48 -e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
Daniel Dunbar7af18d32009-09-17 19:55:53 +000049 -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
Daniel Dunbar1b720a92009-09-20 19:04:35 +000050 -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
51 -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
Daniel Dunbar7af18d32009-09-17 19:55:53 +000052 $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
Daniel Dunbar58033312009-09-10 23:00:15 +000053
Gabor Greif17feadf2008-03-18 07:03:00 +000054clean::
Gabor Greif5267d7c2008-03-20 14:28:22 +000055 @ rm -rf Output/
Gabor Greif17feadf2008-03-18 07:03:00 +000056
Chris Lattner9d294b92008-04-06 22:32:01 +000057.PHONY: all report clean