blob: 1a109758bad94f0c0654e943c360d69ceaf05c42 [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 \
32 --path $(ToolDir) \
33 --path $(LLVM_SRC_ROOT)/test/Scripts \
Daniel Dunbar58033312009-09-10 23:00:15 +000034 $(TESTARGS) $(LIT2_TESTDIRS) $(VGARG)
Daniel Dunbar724827f2009-09-08 16:39:23 +000035else
Chris Lattner1467e032007-07-16 04:35:52 +000036all::
Mike Stumpe3c75e02009-03-13 00:41:24 +000037 @ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
Daniel Dunbar67796472009-07-27 19:01:13 +000038 @ $(PROJ_SRC_DIR)/../utils/test/MultiTestRunner.py \
Daniel Dunbar1db467f2009-07-31 05:54:17 +000039 --root $(PROJ_SRC_DIR) \
Daniel Dunbar67796472009-07-27 19:01:13 +000040 --path $(ToolDir) \
41 --path $(LLVM_SRC_ROOT)/test/Scripts \
42 $(TESTARGS) $(TESTDIRS) $(VGARG)
Daniel Dunbar724827f2009-09-08 16:39:23 +000043endif
Gabor Greif17feadf2008-03-18 07:03:00 +000044
Daniel Dunbar58033312009-09-10 23:00:15 +000045FORCE:
46
47lit.site.cfg: FORCE
48 @echo "Making 'lit.site.cfg' file..."
49 @echo "## Autogenerated by Makefile ##" > $@
50 @echo "# Do not edit!" >> $@
51 @echo >> $@
52 @echo "# Preserve some key paths for use by main LLVM test suite config." >> $@
53 @echo "config.clang_obj_root = \"\"\"$(PROJ_OBJ_DIR)/..\"\"\"" >> $@
54 @echo >> $@
55 @echo "# Let the main config do the real work." >> $@
56 @echo "lit.load_config(config, \"\"\"$(PROJ_SRC_DIR)/lit.cfg\"\"\")" >> $@
57
Gabor Greif17feadf2008-03-18 07:03:00 +000058clean::
Gabor Greif5267d7c2008-03-20 14:28:22 +000059 @ rm -rf Output/
Gabor Greif17feadf2008-03-18 07:03:00 +000060
Chris Lattner9d294b92008-04-06 22:32:01 +000061.PHONY: all report clean