blob: 223fd8380b9fc8ca0311b7ebd8f629add16e8d0b [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 Dunbar724827f2009-09-08 16:39:23 +000028ifdef LIT2
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
46 @echo "Making 'lit.site.cfg' file..."
Daniel Dunbar7af18d32009-09-17 19:55:53 +000047 @sed -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
48 -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
49 -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
50 $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
Daniel Dunbar58033312009-09-10 23:00:15 +000051
Gabor Greif17feadf2008-03-18 07:03:00 +000052clean::
Gabor Greif5267d7c2008-03-20 14:28:22 +000053 @ rm -rf Output/
Gabor Greif17feadf2008-03-18 07:03:00 +000054
Chris Lattner9d294b92008-04-06 22:32:01 +000055.PHONY: all report clean