Chris Lattner | 1467e03 | 2007-07-16 04:35:52 +0000 | [diff] [blame] | 1 | LEVEL = ../../.. |
| 2 | include $(LEVEL)/Makefile.common |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 3 | |
Daniel Dunbar | 0126e5e | 2009-07-12 19:00:20 +0000 | [diff] [blame] | 4 | # Test in all immediate subdirectories if unset. |
Daniel Dunbar | 2f42d4a | 2009-09-04 17:40:27 +0000 | [diff] [blame] | 5 | ifdef TESTSUITE |
| 6 | TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%) |
| 7 | else |
Daniel Dunbar | 10aebbb | 2009-07-25 15:26:08 +0000 | [diff] [blame] | 8 | TESTDIRS ?= $(PROJ_SRC_DIR) |
Daniel Dunbar | 2f42d4a | 2009-09-04 17:40:27 +0000 | [diff] [blame] | 9 | endif |
Chris Lattner | 15bd799 | 2008-03-10 19:32:31 +0000 | [diff] [blame] | 10 | |
Daniel Dunbar | 5e01e3c | 2009-09-22 05:16:02 +0000 | [diff] [blame] | 11 | # 'lit' wants objdir paths, so it will pick up the lit.site.cfg. |
| 12 | TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%) |
Daniel Dunbar | 5803331 | 2009-09-10 23:00:15 +0000 | [diff] [blame] | 13 | |
Daniel Dunbar | 6516813 | 2009-11-05 06:55:24 +0000 | [diff] [blame] | 14 | # Allow EXTRA_TESTDIRS to provide additional test directories. |
| 15 | TESTDIRS += $(EXTRA_TESTDIRS) |
| 16 | |
Daniel Dunbar | d5134b0 | 2009-06-13 18:28:48 +0000 | [diff] [blame] | 17 | ifndef TESTARGS |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 18 | ifdef VERBOSE |
Chris Lattner | 984ec48 | 2010-05-12 02:47:23 +0000 | [diff] [blame] | 19 | TESTARGS = -v |
Mike Stump | 039df91 | 2009-03-13 00:21:49 +0000 | [diff] [blame] | 20 | else |
Chris Lattner | eb94155 | 2010-05-15 16:54:46 +0000 | [diff] [blame^] | 21 | TESTARGS = -s -v -j16 |
Mike Stump | 9a2f1ac | 2009-03-18 20:25:18 +0000 | [diff] [blame] | 22 | endif |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 23 | endif |
| 24 | |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 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 |
| 27 | |
Nuno Lopes | a7afc45 | 2009-07-11 18:34:43 +0000 | [diff] [blame] | 28 | ifdef VG |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 29 | LIT_ARGS += "--vg" |
Nuno Lopes | a7afc45 | 2009-07-11 18:34:43 +0000 | [diff] [blame] | 30 | endif |
| 31 | |
Daniel Dunbar | 5803331 | 2009-09-10 23:00:15 +0000 | [diff] [blame] | 32 | all:: lit.site.cfg |
Daniel Dunbar | 724827f | 2009-09-08 16:39:23 +0000 | [diff] [blame] | 33 | @ echo '--- Running clang tests for $(TARGET_TRIPLE) ---' |
Douglas Gregor | b3496c7 | 2009-09-29 14:54:28 +0000 | [diff] [blame] | 34 | @ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \ |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 35 | $(LIT_ARGS) $(TESTARGS) $(TESTDIRS) |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 36 | |
Daniel Dunbar | 5803331 | 2009-09-10 23:00:15 +0000 | [diff] [blame] | 37 | FORCE: |
| 38 | |
| 39 | lit.site.cfg: FORCE |
Daniel Dunbar | 1b720a9 | 2009-09-20 19:04:35 +0000 | [diff] [blame] | 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" \ |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 43 | -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \ |
Daniel Dunbar | 9e10cc7 | 2009-09-26 07:36:09 +0000 | [diff] [blame] | 44 | -e "s#@LLVM_LIBS_DIR@#$(LibDir)#g" \ |
Daniel Dunbar | 1b720a9 | 2009-09-20 19:04:35 +0000 | [diff] [blame] | 45 | -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \ |
| 46 | -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \ |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 47 | -e "s#@TARGET_TRIPLE@#$(TARGET_TRIPLE)#g" \ |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 48 | $(PROJ_SRC_DIR)/lit.site.cfg.in > $@ |
Daniel Dunbar | 5803331 | 2009-09-10 23:00:15 +0000 | [diff] [blame] | 49 | |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 50 | clean:: |
Nuno Lopes | f758dc0 | 2009-11-03 22:39:56 +0000 | [diff] [blame] | 51 | @ find . -name Output | xargs rm -fr |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 52 | |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 53 | .PHONY: all report clean |