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 | 5803331 | 2009-09-10 23:00:15 +0000 | [diff] [blame^] | 11 | # LIT2 wants objdir paths, so it will pick up the lit.site.cfg. |
| 12 | LIT2_TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%) |
| 13 | |
Daniel Dunbar | d5134b0 | 2009-06-13 18:28:48 +0000 | [diff] [blame] | 14 | ifndef TESTARGS |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 15 | ifdef VERBOSE |
Daniel Dunbar | d5134b0 | 2009-06-13 18:28:48 +0000 | [diff] [blame] | 16 | TESTARGS = -v |
Mike Stump | 039df91 | 2009-03-13 00:21:49 +0000 | [diff] [blame] | 17 | else |
Daniel Dunbar | d5134b0 | 2009-06-13 18:28:48 +0000 | [diff] [blame] | 18 | TESTARGS = -s |
Mike Stump | 9a2f1ac | 2009-03-18 20:25:18 +0000 | [diff] [blame] | 19 | endif |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 20 | endif |
| 21 | |
Nuno Lopes | a7afc45 | 2009-07-11 18:34:43 +0000 | [diff] [blame] | 22 | ifdef VG |
| 23 | VGARG="--vg" |
| 24 | else |
| 25 | VGARG= |
| 26 | endif |
| 27 | |
Daniel Dunbar | 724827f | 2009-09-08 16:39:23 +0000 | [diff] [blame] | 28 | ifdef LIT2 |
Daniel Dunbar | 5803331 | 2009-09-10 23:00:15 +0000 | [diff] [blame^] | 29 | all:: lit.site.cfg |
Daniel Dunbar | 724827f | 2009-09-08 16:39:23 +0000 | [diff] [blame] | 30 | @ 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 Dunbar | 5803331 | 2009-09-10 23:00:15 +0000 | [diff] [blame^] | 34 | $(TESTARGS) $(LIT2_TESTDIRS) $(VGARG) |
Daniel Dunbar | 724827f | 2009-09-08 16:39:23 +0000 | [diff] [blame] | 35 | else |
Chris Lattner | 1467e03 | 2007-07-16 04:35:52 +0000 | [diff] [blame] | 36 | all:: |
Mike Stump | e3c75e0 | 2009-03-13 00:41:24 +0000 | [diff] [blame] | 37 | @ echo '--- Running clang tests for $(TARGET_TRIPLE) ---' |
Daniel Dunbar | 6779647 | 2009-07-27 19:01:13 +0000 | [diff] [blame] | 38 | @ $(PROJ_SRC_DIR)/../utils/test/MultiTestRunner.py \ |
Daniel Dunbar | 1db467f | 2009-07-31 05:54:17 +0000 | [diff] [blame] | 39 | --root $(PROJ_SRC_DIR) \ |
Daniel Dunbar | 6779647 | 2009-07-27 19:01:13 +0000 | [diff] [blame] | 40 | --path $(ToolDir) \ |
| 41 | --path $(LLVM_SRC_ROOT)/test/Scripts \ |
| 42 | $(TESTARGS) $(TESTDIRS) $(VGARG) |
Daniel Dunbar | 724827f | 2009-09-08 16:39:23 +0000 | [diff] [blame] | 43 | endif |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 44 | |
Daniel Dunbar | 5803331 | 2009-09-10 23:00:15 +0000 | [diff] [blame^] | 45 | FORCE: |
| 46 | |
| 47 | lit.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 Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 58 | clean:: |
Gabor Greif | 5267d7c | 2008-03-20 14:28:22 +0000 | [diff] [blame] | 59 | @ rm -rf Output/ |
Gabor Greif | 17feadf | 2008-03-18 07:03:00 +0000 | [diff] [blame] | 60 | |
Chris Lattner | 9d294b9 | 2008-04-06 22:32:01 +0000 | [diff] [blame] | 61 | .PHONY: all report clean |